added missing translations

This commit is contained in:
Bnyro 2022-06-17 16:39:05 +02:00
parent bf2ac25567
commit fc9fbb0db2
3 changed files with 14 additions and 9 deletions

View File

@ -113,15 +113,15 @@ class DownloadService : Service() {
"mux" -> {
audioDir = File(tempDir, "$videoId-audio")
videoDir = File(tempDir, "$videoId-video")
downloadId = downloadManagerRequest("Video", "Downloading", videoUrl, videoDir)
downloadId = downloadManagerRequest(getString(R.string.video), getString(R.string.downloading), videoUrl, videoDir)
}
"video" -> {
videoDir = File(libretubeDir, "$videoId-video")
downloadId = downloadManagerRequest("Video", "Downloading", videoUrl, videoDir)
downloadId = downloadManagerRequest(getString(R.string.video), getString(R.string.downloading), videoUrl, videoDir)
}
"audio" -> {
audioDir = File(libretubeDir, "$videoId-audio")
downloadId = downloadManagerRequest("Audio", "Downloading", audioUrl, audioDir)
downloadId = downloadManagerRequest(getString(R.string.audio), getString(R.string.downloading), audioUrl, audioDir)
}
}
} catch (e: IllegalArgumentException) {
@ -136,7 +136,7 @@ class DownloadService : Service() {
// Checking if the received broadcast is for our enqueued download by matching download id
if (downloadId == id) {
if (downloadType == "mux") {
downloadManagerRequest("Audio", "Downloading", audioUrl, audioDir)
downloadManagerRequest(getString(R.string.video), getString(R.string.downloading), audioUrl, audioDir)
} else {
downloadSucceededNotification()
onDestroy()
@ -178,7 +178,7 @@ class DownloadService : Service() {
NotificationCompat.Builder(this@DownloadService, "download_service")
.setSmallIcon(R.drawable.ic_download)
.setContentTitle("LibreTube")
.setContentText("Downloading")
.setContentText(getString(R.string.downloading))
.setPriority(NotificationCompat.PRIORITY_LOW)
.setOngoing(true)
.setOnlyAlertOnce(true)
@ -192,7 +192,7 @@ class DownloadService : Service() {
val builder = NotificationCompat.Builder(this@DownloadService, "download_service")
.setSmallIcon(R.drawable.ic_download)
.setContentTitle(resources.getString(R.string.downloadfailed))
.setContentText("failure")
.setContentText(getString(R.string.fail))
.setPriority(NotificationCompat.PRIORITY_HIGH)
with(NotificationManagerCompat.from(this@DownloadService)) {
// notificationId is a unique int for each notification that you must define
@ -205,7 +205,7 @@ class DownloadService : Service() {
val builder = NotificationCompat.Builder(this@DownloadService, "download_service")
.setSmallIcon(R.drawable.ic_download)
.setContentTitle(resources.getString(R.string.success))
.setContentText("success")
.setContentText(getString(R.string.fail))
.setPriority(NotificationCompat.PRIORITY_HIGH)
with(NotificationManagerCompat.from(this@DownloadService)) {
// notificationId is a unique int for each notification that you must define

View File

@ -71,7 +71,7 @@ class DownloadDialog : DialogFragment() {
}
}
var vidName = arrayListOf<String>()
vidName.add("No video")
vidName.add(getString(R.string.no_video))
var vidUrl = arrayListOf<String>()
vidUrl.add("")
for (vid in streams.videoStreams!!) {
@ -80,7 +80,7 @@ class DownloadDialog : DialogFragment() {
vidUrl.add(vid.url!!)
}
var audioName = arrayListOf<String>()
audioName.add("No audio")
audioName.add(getString(R.string.no_audio))
var audioUrl = arrayListOf<String>()
audioUrl.add("")
for (audio in streams.audioStreams!!) {

View File

@ -184,4 +184,9 @@
<string name="buffering_goal">Preloading</string>
<string name="buffering_goal_summary">Max. amount of seconds of video to buffer.</string>
<string name="playerVideoFormat">Video format for player</string>
<string name="no_audio">No audio</string>
<string name="no_video">No video</string>
<string name="audio">Audio</string>
<string name="video">Video</string>
<string name="downloading">Downloading</string>
</resources>