From e42f822d69ce185e3ece5a7986e7a618ad12a940 Mon Sep 17 00:00:00 2001 From: LagradOst Date: Thu, 2 Sep 2021 18:51:13 +0200 Subject: [PATCH] more lang stuff --- .../lagradost/cloudstream3/MainActivity.kt | 33 +++++++++++++------ .../ui/download/DownloadButtonSetup.kt | 14 ++++++++ .../ui/download/DownloadChildAdapter.kt | 1 + .../ui/download/DownloadChildFragment.kt | 3 ++ .../ui/download/DownloadFragment.kt | 3 ++ .../ui/download/EasyDownloadButton.kt | 18 +++++++--- .../cloudstream3/ui/home/HomeFragment.kt | 3 ++ .../cloudstream3/ui/player/PlayerFragment.kt | 5 +++ .../cloudstream3/ui/result/ResultFragment.kt | 3 ++ .../cloudstream3/ui/search/SearchFragment.kt | 3 ++ .../ui/settings/SettingsFragment.kt | 2 ++ .../ui/subtitles/SubtitlesFragment.kt | 2 ++ .../utils/SingleSelectionHelper.kt | 10 ++++++ .../utils/VideoDownloadManager.kt | 32 ++++++++++-------- .../res/layout/download_child_episode.xml | 2 +- .../res/layout/download_header_episode.xml | 4 +-- app/src/main/res/layout/result_episode.xml | 2 +- .../main/res/layout/result_episode_large.xml | 2 +- app/src/main/res/values-gr/strings.xml | 2 +- app/src/main/res/values-nl/strings.xml | 2 +- app/src/main/res/values-sv/strings.xml | 32 +++++++++++------- app/src/main/res/values/strings.xml | 16 +++++++-- 22 files changed, 144 insertions(+), 50 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt index 45a14279..5a2d004c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt @@ -3,10 +3,11 @@ package com.lagradost.cloudstream3 import android.app.Activity import android.app.PictureInPictureParams import android.content.ComponentName +import android.content.Context import android.content.Intent import android.content.pm.PackageManager import android.content.res.ColorStateList -import android.content.res.Configuration +import android.content.res.Resources import android.os.Build import android.os.Bundle import android.view.* @@ -22,6 +23,7 @@ import com.google.android.gms.cast.framework.CastButtonFactory import com.jaredrummler.android.colorpicker.ColorPickerDialogListener import com.lagradost.cloudstream3.APIHolder.apis import com.lagradost.cloudstream3.APIHolder.restrictedApis +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.receivers.VideoDownloadRestartReceiver import com.lagradost.cloudstream3.ui.download.DOWNLOAD_NAVIGATE_TO import com.lagradost.cloudstream3.ui.download.DownloadChildFragment @@ -114,15 +116,25 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { } } - fun setLocale(activity: Activity?, languageCode: String?) { - if (activity == null || languageCode == null) return + fun setLocale(context: Context?, languageCode: String?) { + if (context == null || languageCode == null) return val locale = Locale(languageCode) + val resources: Resources = context.resources + val config = resources.configuration Locale.setDefault(locale) - val resources = activity.resources - val config: Configuration = resources.configuration config.setLocale(locale) + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) + context.createConfigurationContext(config) resources.updateConfiguration(config, resources.displayMetrics) } + + fun Context.updateLocale() { + val settingsManager = PreferenceManager.getDefaultSharedPreferences(this) + val localeCode = settingsManager.getString(getString(R.string.locale_key), null) + println("LOCALE: " + localeCode) + setLocale(this, localeCode) + } } private fun enterPIPMode() { @@ -174,13 +186,18 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { .remove(currentFragment) .commitAllowingStateLoss() backEvent.invoke(true) + this.updateLocale() return true } backEvent.invoke(false) + this.updateLocale() + return false } override fun onBackPressed() { + this.updateLocale() + if (backPressed()) return super.onBackPressed() } @@ -238,11 +255,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { R.style.LoadedStyle, true ) // THEME IS SET BEFORE VIEW IS CREATED TO APPLY THE THEME TO THE MAIN VIEW - - val settingsManager = PreferenceManager.getDefaultSharedPreferences(this) - val localeCode = settingsManager.getString(getString(R.string.locale_key), null) - setLocale(this, localeCode) - + updateLocale() super.onCreate(savedInstanceState) window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadButtonSetup.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadButtonSetup.kt index 928e7b79..0d8d47bb 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadButtonSetup.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadButtonSetup.kt @@ -2,8 +2,10 @@ package com.lagradost.cloudstream3.ui.download import android.app.Activity import android.content.DialogInterface +import android.widget.Toast import androidx.appcompat.app.AlertDialog import androidx.fragment.app.FragmentActivity +import com.lagradost.cloudstream3.MainActivity import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.ui.player.PlayerFragment import com.lagradost.cloudstream3.ui.player.UriData @@ -62,6 +64,18 @@ object DownloadButtonSetup { } } } + DOWNLOAD_ACTION_LONG_CLICK -> { + activity?.let { act -> + val length = + VideoDownloadManager.getDownloadFileInfoAndUpdateSettings(act, click.data.id)?.fileLength + ?: 0 + if(length > 0) { + MainActivity.showToast(act, R.string.delete, Toast.LENGTH_LONG) + } else { + MainActivity.showToast(act, R.string.download, Toast.LENGTH_LONG) + } + } + } DOWNLOAD_ACTION_PLAY_FILE -> { activity?.let { act -> val info = diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadChildAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadChildAdapter.kt index 7f9a6307..95d7a6e0 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadChildAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadChildAdapter.kt @@ -21,6 +21,7 @@ const val DOWNLOAD_ACTION_DELETE_FILE = 1 const val DOWNLOAD_ACTION_RESUME_DOWNLOAD = 2 const val DOWNLOAD_ACTION_PAUSE_DOWNLOAD = 3 const val DOWNLOAD_ACTION_DOWNLOAD = 4 +const val DOWNLOAD_ACTION_LONG_CLICK = 5 data class VisualDownloadChildCached( val currentBytes: Long, diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadChildFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadChildFragment.kt index 680d1927..d830966c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadChildFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadChildFragment.kt @@ -7,6 +7,7 @@ import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbar import com.lagradost.cloudstream3.ui.download.DownloadButtonSetup.handleDownloadClick @@ -41,6 +42,8 @@ class DownloadChildFragment : Fragment() { } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + context?.updateLocale() + return inflater.inflate(R.layout.fragment_child_downloads, container, false) } diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadFragment.kt index 3cd7e04d..98962e31 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadFragment.kt @@ -10,6 +10,7 @@ import androidx.lifecycle.ViewModelProvider import androidx.navigation.findNavController import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.isMovieType import com.lagradost.cloudstream3.mvvm.observe @@ -60,6 +61,8 @@ class DownloadFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View? { + context?.updateLocale() + downloadsViewModel = ViewModelProvider(this).get(DownloadViewModel::class.java) observe(downloadsViewModel.noDownloadsText) { diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/download/EasyDownloadButton.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/download/EasyDownloadButton.kt index 7941ba04..94b1f28e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/download/EasyDownloadButton.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/download/EasyDownloadButton.kt @@ -81,15 +81,18 @@ class EasyDownloadButton : IDisposable { when (state) { VideoDownloadManager.DownloadType.IsPaused -> Pair( R.drawable.ic_baseline_play_arrow_24, - "Download Paused" + R.string.download_paused ) - VideoDownloadManager.DownloadType.IsDownloading -> Pair(R.drawable.netflix_pause, "Downloading") - else -> Pair(R.drawable.ic_baseline_delete_outline_24, "Downloaded") + VideoDownloadManager.DownloadType.IsDownloading -> Pair( + R.drawable.netflix_pause, + R.string.downloading + ) + else -> Pair(R.drawable.ic_baseline_delete_outline_24, R.string.downloaded) } } else { - Pair(R.drawable.netflix_download, "Download") + Pair(R.drawable.netflix_download, R.string.download) } - downloadImageChangeCallback.invoke(img) + downloadImageChangeCallback.invoke(Pair(img.first, downloadView.context.getString(img.second))) } fun fixDownloadedBytes(setCurrentBytes: Long, setTotalBytes: Long, animate: Boolean) { @@ -185,5 +188,10 @@ class EasyDownloadButton : IDisposable { } } } + + downloadView.setOnLongClickListener { + clickCallback.invoke(DownloadClickEvent(DOWNLOAD_ACTION_LONG_CLICK, data)) + return@setOnLongClickListener true + } } } diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt index c0430f38..79907c5c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt @@ -19,6 +19,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.APIHolder.apis import com.lagradost.cloudstream3.MainActivity.Companion.backEvent +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.mvvm.Resource import com.lagradost.cloudstream3.mvvm.observe import com.lagradost.cloudstream3.ui.AutofitRecyclerView @@ -95,6 +96,8 @@ class HomeFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View? { + context?.updateLocale() + homeViewModel = ViewModelProvider(this).get(HomeViewModel::class.java) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt index 7591efe5..481638a1 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt @@ -68,6 +68,7 @@ import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.MainActivity.Companion.canEnterPipMode import com.lagradost.cloudstream3.MainActivity.Companion.isInPIPMode import com.lagradost.cloudstream3.MainActivity.Companion.showToast +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.mvvm.Resource import com.lagradost.cloudstream3.mvvm.normalSafeApiCall @@ -948,6 +949,8 @@ class PlayerFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) context?.let { ctx -> + ctx.updateLocale() + setPreferredSubLanguage(ctx.getAutoSelectLanguageISO639_1()) } @@ -2045,6 +2048,8 @@ class PlayerFragment : Fragment() { } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + context?.updateLocale() + return inflater.inflate(R.layout.fragment_player, container, false) } } \ No newline at end of file diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt index 8335a0a7..61444df0 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt @@ -32,6 +32,7 @@ import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.APIHolder.getApiFromName import com.lagradost.cloudstream3.APIHolder.getId import com.lagradost.cloudstream3.MainActivity.Companion.showToast +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.mvvm.Resource import com.lagradost.cloudstream3.mvvm.observe import com.lagradost.cloudstream3.ui.WatchType @@ -168,6 +169,8 @@ class ResultFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle?, ): View? { + context?.updateLocale() + viewModel = ViewModelProvider(activity ?: this).get(ResultViewModel::class.java) return inflater.inflate(R.layout.fragment_result, container, false) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt index 2b11ef68..1744e891 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt @@ -21,6 +21,7 @@ import com.lagradost.cloudstream3.APIHolder.apis import com.lagradost.cloudstream3.APIHolder.getApiSettings import com.lagradost.cloudstream3.APIHolder.getApiTypeSettings import com.lagradost.cloudstream3.HomePageList +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.TvType import com.lagradost.cloudstream3.mvvm.Resource @@ -47,6 +48,8 @@ class SearchFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle?, ): View? { + context?.updateLocale() + searchViewModel = ViewModelProvider(this).get(SearchViewModel::class.java) activity?.window?.setSoftInputMode( diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt index 9c436061..265f045d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt @@ -7,6 +7,7 @@ import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceManager import com.lagradost.cloudstream3.MainActivity.Companion.setLocale import com.lagradost.cloudstream3.MainActivity.Companion.showToast +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.ui.subtitles.SubtitlesFragment @@ -20,6 +21,7 @@ class SettingsFragment : PreferenceFragmentCompat() { var count = 0 override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + context?.updateLocale() hideKeyboard() setPreferencesFromResource(R.xml.settings, rootKey) val updatePreference = findPreference(getString(R.string.manual_check_update_key))!! diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/SubtitlesFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/SubtitlesFragment.kt index 4a2d4b32..068775f2 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/SubtitlesFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/SubtitlesFragment.kt @@ -22,6 +22,7 @@ import com.google.android.exoplayer2.ui.CaptionStyleCompat import com.jaredrummler.android.colorpicker.ColorPickerDialog import com.lagradost.cloudstream3.MainActivity import com.lagradost.cloudstream3.MainActivity.Companion.showToast +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.utils.DataStore.getKey import com.lagradost.cloudstream3.utils.DataStore.setKey @@ -174,6 +175,7 @@ class SubtitlesFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle?, ): View? { + context?.updateLocale() return inflater.inflate(R.layout.subtitle_settings, container, false) } diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/SingleSelectionHelper.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/SingleSelectionHelper.kt index c1ac4f12..6378c2bf 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/SingleSelectionHelper.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/SingleSelectionHelper.kt @@ -9,7 +9,9 @@ import androidx.core.view.marginLeft import androidx.core.view.marginRight import androidx.core.view.marginTop import com.google.android.material.bottomsheet.BottomSheetDialog +import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale import com.lagradost.cloudstream3.R +import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog object SingleSelectionHelper { fun Context.showDialog( @@ -22,6 +24,8 @@ object SingleSelectionHelper { callback: (List) -> Unit, dismissCallback: () -> Unit ) { + this.updateLocale() + val realShowApply = showApply || isMultiSelect val listView = dialog.findViewById(R.id.listview1)!! val textView = dialog.findViewById(R.id.text1)!! @@ -96,6 +100,8 @@ object SingleSelectionHelper { dismissCallback: () -> Unit, callback: (List) -> Unit, ) { + this.updateLocale() + val builder = AlertDialog.Builder(this, R.style.AlertDialogCustom).setView(R.layout.bottom_selection_dialog) @@ -112,6 +118,8 @@ object SingleSelectionHelper { dismissCallback: () -> Unit, callback: (Int) -> Unit, ) { + this.updateLocale() + val builder = AlertDialog.Builder(this, R.style.AlertDialogCustom).setView(R.layout.bottom_selection_dialog) @@ -137,6 +145,8 @@ object SingleSelectionHelper { dismissCallback: () -> Unit, callback: (Int) -> Unit, ) { + this.updateLocale() + val builder = BottomSheetDialog(this) builder.setContentView(R.layout.bottom_selection_dialog) diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt index 0ce3169f..b350ba78 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt @@ -263,12 +263,13 @@ object VideoDownloadManager { val rowTwoExtra = if (ep.name != null) " - ${ep.name}\n" else "" val rowTwo = if (ep.season != null && ep.episode != null) { - "S${ep.season}:E${ep.episode}" + rowTwoExtra + "${context.getString(R.string.season_short)}${ep.season}:${context.getString(R.string.episode_short)}${ep.episode}" + rowTwoExtra } else if (ep.episode != null) { - "Episode ${ep.episode}" + rowTwoExtra + "${context.getString(R.string.episode)} ${ep.episode}" + rowTwoExtra } else { (ep.name ?: "") + "" } + val downloadFormat = context.getString(R.string.download_format) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (ep.poster != null) { @@ -282,16 +283,15 @@ object VideoDownloadManager { val progressPercentage = progress * 100 / total val progressMbString = "%.1f".format(progress / 1000000f) val totalMbString = "%.1f".format(total / 1000000f) - val bigText = if (state == DownloadType.IsDownloading || state == DownloadType.IsPaused) { (if (linkName == null) "" else "$linkName\n") + "$rowTwo\n$progressPercentage % ($progressMbString MB/$totalMbString MB)" } else if (state == DownloadType.IsFailed) { - "Download Failed - $rowTwo" + downloadFormat.format(context.getString(R.string.download_failed), rowTwo) } else if (state == DownloadType.IsDone) { - "Download Done - $rowTwo" + downloadFormat.format(context.getString(R.string.download_done), rowTwo) } else { - "Download Canceled - $rowTwo" + downloadFormat.format(context.getString(R.string.download_canceled), rowTwo) } val bodyStyle = NotificationCompat.BigTextStyle() @@ -301,11 +301,11 @@ object VideoDownloadManager { val txt = if (state == DownloadType.IsDownloading || state == DownloadType.IsPaused) { rowTwo } else if (state == DownloadType.IsFailed) { - "Download Failed - $rowTwo" + downloadFormat.format(context.getString(R.string.download_failed), rowTwo) } else if (state == DownloadType.IsDone) { - "Download Done - $rowTwo" + downloadFormat.format(context.getString(R.string.download_done), rowTwo) } else { - "Download Canceled - $rowTwo" + downloadFormat.format(context.getString(R.string.download_canceled), rowTwo) } builder.setContentText(txt) @@ -352,9 +352,9 @@ object VideoDownloadManager { DownloadActionType.Pause -> pressToPauseIcon DownloadActionType.Stop -> pressToStopIcon }, when (i) { - DownloadActionType.Resume -> "Resume" - DownloadActionType.Pause -> "Pause" - DownloadActionType.Stop -> "Cancel" + DownloadActionType.Resume -> context.getString(R.string.resume) + DownloadActionType.Pause -> context.getString(R.string.pause) + DownloadActionType.Stop -> context.getString(R.string.cancel) }, pending ) ) @@ -1278,7 +1278,7 @@ object VideoDownloadManager { link: ExtractorLink, tryResume: Boolean = false, ): Int { - val name = sanitizeFilename(ep.name ?: "Episode ${ep.episode}") + val name = sanitizeFilename(ep.name ?: "${context.getString(R.string.episode)} ${ep.episode}") if (link.isM3u8 || link.url.endsWith(".m3u8")) { val startIndex = if (tryResume) { @@ -1413,7 +1413,11 @@ object VideoDownloadManager { main { showToast( // can be replaced with regular Toast context, - "${pkg.item.ep.mainName}${pkg.item.ep.episode?.let { " ${context.getString(R.string.episode)} $it " } ?: " "}${context.getString(R.string.queued)}", + "${pkg.item.ep.mainName}${pkg.item.ep.episode?.let { " ${context.getString(R.string.episode)} $it " } ?: " "}${ + context.getString( + R.string.queued + ) + }", Toast.LENGTH_SHORT ) } diff --git a/app/src/main/res/layout/download_child_episode.xml b/app/src/main/res/layout/download_child_episode.xml index 2ff4f791..263b750f 100644 --- a/app/src/main/res/layout/download_child_episode.xml +++ b/app/src/main/res/layout/download_child_episode.xml @@ -100,7 +100,7 @@ android:id="@+id/download_child_episode_download" android:background="?selectableItemBackgroundBorderless" android:src="@drawable/ic_baseline_play_arrow_24" - android:contentDescription="@string/download_descript"/> + android:contentDescription="@string/download"/> \ No newline at end of file diff --git a/app/src/main/res/layout/download_header_episode.xml b/app/src/main/res/layout/download_header_episode.xml index 14537500..c7ddb23d 100644 --- a/app/src/main/res/layout/download_header_episode.xml +++ b/app/src/main/res/layout/download_header_episode.xml @@ -60,7 +60,7 @@ android:id="@+id/download_header_goto_child" android:layout_gravity="center_vertical|end" android:src="@drawable/ic_baseline_keyboard_arrow_right_24" - android:contentDescription="@string/download_descript"/> + android:contentDescription="@string/download"/> + android:contentDescription="@string/download"/> \ No newline at end of file diff --git a/app/src/main/res/layout/result_episode.xml b/app/src/main/res/layout/result_episode.xml index 40ab6e36..6f94fc69 100644 --- a/app/src/main/res/layout/result_episode.xml +++ b/app/src/main/res/layout/result_episode.xml @@ -93,7 +93,7 @@ android:id="@+id/result_episode_download" android:background="?selectableItemBackgroundBorderless" android:src="@drawable/ic_baseline_play_arrow_24" - android:contentDescription="@string/download_descript"/> + android:contentDescription="@string/download"/> \ No newline at end of file diff --git a/app/src/main/res/layout/result_episode_large.xml b/app/src/main/res/layout/result_episode_large.xml index 0f39fcee..c9634a63 100644 --- a/app/src/main/res/layout/result_episode_large.xml +++ b/app/src/main/res/layout/result_episode_large.xml @@ -108,7 +108,7 @@ android:id="@+id/result_episode_download" android:background="?selectableItemBackgroundBorderless" android:src="@drawable/ic_baseline_play_arrow_24" - android:contentDescription="@string/download_descript"/> + android:contentDescription="@string/download"/> Πόστερ Αναπαραγωγή Επισοδείου Δώσε άδεια για την λήψη επισοδείου - Λήξη + Λήξη Σφάλμα φόρτωσεις συνδέσμων Εσωτερικός χώρος Επιλογές diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index f2a58bad..6f222bd0 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -40,7 +40,7 @@ Afleveringsposter Aflevering afspelen Toestaan om afleveringen te downloaden - Download + Download Fout bij laden van links Interne opslag Opties diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 5ed0e0d6..eef02fa0 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -2,11 +2,12 @@ Betygsatt: %.1f Hastighet (%.2fx) + Ny uppdatering hittad!\n%s -> %s CloudStream Hem Sök - Nerladdningar + Nedladdningar Instälningar Sök… Ändra Providers @@ -33,23 +34,21 @@ Spela Upp Strömma Torrent - Sources + Källor Undertexter Försök ansluta igen… Gå tillbaka @string/result_poster Spela Avsnitt Allow to download episodes - Ladda ner + Ladda ner Intern lagring Dub Sub - Radera + Ta bort Spela upp - Resume Download - Pause Download Inaktivera automatisk felrapportering Mer information @@ -82,7 +81,7 @@ unknown_prerelease Autoval av undertextspråk - Automatisk nerladdaning av språk + Automatisk nedladdaning av språk Håll inne för att återställa till standard Fortsätt titta @@ -133,7 +132,7 @@ Inga länkar hittades Länken kopierades till urklipp Spela upp avsnitt - Återställ till standardvärdet + Återställd till standardvärdet Programmet kraschade tyvärr. En anonym felrapport kommer att skickas till utvecklarna Fel uppstod vid laddning av länkarna @@ -144,7 +143,7 @@ S A - Ta bort nerladdad fil + Ta bort nedladdad fil Ta bort Denna fil kommer att raderas permanent %s\nÄr du helt säker? @@ -190,7 +189,18 @@ Hoppa över OP Visa inte igen - Nerladdning startad - Nerladdning Misslyckades Uppdatering + + Nedladdningar startad + Nedladdning Misslyckades + Nedladdad + Laddar ner + Nedladdning Pausad + Nedladdning Avbryten + Nedladdning Färdig + Återupta nedladdning + Pausa nedladdning + + Pausa + Återuppta diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 971a7587..da17d2b0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -61,7 +61,17 @@ Episode Poster Play Episode Allow to download episodes - Download + + Download + Downloaded + Downloading + Download Paused + Download Started + Download Failed + Download Canceled + Download Done + %s - %s + Error Loading Links Internal Storage @@ -170,6 +180,8 @@ Delete File Delete @string/sort_cancel + Pause + Resume This will permanently delete %s\nAre you sure? Ongoing @@ -219,7 +231,5 @@ Skip OP Don\'t show again - Download started - Download Failed Update