more lang stuff

This commit is contained in:
LagradOst 2021-09-02 18:51:13 +02:00
parent 0fada350f5
commit e42f822d69
22 changed files with 144 additions and 50 deletions

View File

@ -3,10 +3,11 @@ package com.lagradost.cloudstream3
import android.app.Activity import android.app.Activity
import android.app.PictureInPictureParams import android.app.PictureInPictureParams
import android.content.ComponentName import android.content.ComponentName
import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.content.res.Configuration import android.content.res.Resources
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.* import android.view.*
@ -22,6 +23,7 @@ import com.google.android.gms.cast.framework.CastButtonFactory
import com.jaredrummler.android.colorpicker.ColorPickerDialogListener import com.jaredrummler.android.colorpicker.ColorPickerDialogListener
import com.lagradost.cloudstream3.APIHolder.apis import com.lagradost.cloudstream3.APIHolder.apis
import com.lagradost.cloudstream3.APIHolder.restrictedApis import com.lagradost.cloudstream3.APIHolder.restrictedApis
import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale
import com.lagradost.cloudstream3.receivers.VideoDownloadRestartReceiver import com.lagradost.cloudstream3.receivers.VideoDownloadRestartReceiver
import com.lagradost.cloudstream3.ui.download.DOWNLOAD_NAVIGATE_TO import com.lagradost.cloudstream3.ui.download.DOWNLOAD_NAVIGATE_TO
import com.lagradost.cloudstream3.ui.download.DownloadChildFragment import com.lagradost.cloudstream3.ui.download.DownloadChildFragment
@ -114,15 +116,25 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
} }
} }
fun setLocale(activity: Activity?, languageCode: String?) { fun setLocale(context: Context?, languageCode: String?) {
if (activity == null || languageCode == null) return if (context == null || languageCode == null) return
val locale = Locale(languageCode) val locale = Locale(languageCode)
val resources: Resources = context.resources
val config = resources.configuration
Locale.setDefault(locale) Locale.setDefault(locale)
val resources = activity.resources
val config: Configuration = resources.configuration
config.setLocale(locale) config.setLocale(locale)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
context.createConfigurationContext(config)
resources.updateConfiguration(config, resources.displayMetrics) 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() { private fun enterPIPMode() {
@ -174,13 +186,18 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
.remove(currentFragment) .remove(currentFragment)
.commitAllowingStateLoss() .commitAllowingStateLoss()
backEvent.invoke(true) backEvent.invoke(true)
this.updateLocale()
return true return true
} }
backEvent.invoke(false) backEvent.invoke(false)
this.updateLocale()
return false return false
} }
override fun onBackPressed() { override fun onBackPressed() {
this.updateLocale()
if (backPressed()) return if (backPressed()) return
super.onBackPressed() super.onBackPressed()
} }
@ -238,11 +255,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
R.style.LoadedStyle, R.style.LoadedStyle,
true true
) // THEME IS SET BEFORE VIEW IS CREATED TO APPLY THE THEME TO THE MAIN VIEW ) // THEME IS SET BEFORE VIEW IS CREATED TO APPLY THE THEME TO THE MAIN VIEW
updateLocale()
val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
val localeCode = settingsManager.getString(getString(R.string.locale_key), null)
setLocale(this, localeCode)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)

View File

@ -2,8 +2,10 @@ package com.lagradost.cloudstream3.ui.download
import android.app.Activity import android.app.Activity
import android.content.DialogInterface import android.content.DialogInterface
import android.widget.Toast
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.lagradost.cloudstream3.MainActivity
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.ui.player.PlayerFragment import com.lagradost.cloudstream3.ui.player.PlayerFragment
import com.lagradost.cloudstream3.ui.player.UriData 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 -> { DOWNLOAD_ACTION_PLAY_FILE -> {
activity?.let { act -> activity?.let { act ->
val info = val info =

View File

@ -21,6 +21,7 @@ const val DOWNLOAD_ACTION_DELETE_FILE = 1
const val DOWNLOAD_ACTION_RESUME_DOWNLOAD = 2 const val DOWNLOAD_ACTION_RESUME_DOWNLOAD = 2
const val DOWNLOAD_ACTION_PAUSE_DOWNLOAD = 3 const val DOWNLOAD_ACTION_PAUSE_DOWNLOAD = 3
const val DOWNLOAD_ACTION_DOWNLOAD = 4 const val DOWNLOAD_ACTION_DOWNLOAD = 4
const val DOWNLOAD_ACTION_LONG_CLICK = 5
data class VisualDownloadChildCached( data class VisualDownloadChildCached(
val currentBytes: Long, val currentBytes: Long,

View File

@ -7,6 +7,7 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbar import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbar
import com.lagradost.cloudstream3.ui.download.DownloadButtonSetup.handleDownloadClick 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? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
context?.updateLocale()
return inflater.inflate(R.layout.fragment_child_downloads, container, false) return inflater.inflate(R.layout.fragment_child_downloads, container, false)
} }

View File

@ -10,6 +10,7 @@ import androidx.lifecycle.ViewModelProvider
import androidx.navigation.findNavController import androidx.navigation.findNavController
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.isMovieType import com.lagradost.cloudstream3.isMovieType
import com.lagradost.cloudstream3.mvvm.observe import com.lagradost.cloudstream3.mvvm.observe
@ -60,6 +61,8 @@ class DownloadFragment : Fragment() {
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
context?.updateLocale()
downloadsViewModel = downloadsViewModel =
ViewModelProvider(this).get(DownloadViewModel::class.java) ViewModelProvider(this).get(DownloadViewModel::class.java)
observe(downloadsViewModel.noDownloadsText) { observe(downloadsViewModel.noDownloadsText) {

View File

@ -81,15 +81,18 @@ class EasyDownloadButton : IDisposable {
when (state) { when (state) {
VideoDownloadManager.DownloadType.IsPaused -> Pair( VideoDownloadManager.DownloadType.IsPaused -> Pair(
R.drawable.ic_baseline_play_arrow_24, R.drawable.ic_baseline_play_arrow_24,
"Download Paused" R.string.download_paused
) )
VideoDownloadManager.DownloadType.IsDownloading -> Pair(R.drawable.netflix_pause, "Downloading") VideoDownloadManager.DownloadType.IsDownloading -> Pair(
else -> Pair(R.drawable.ic_baseline_delete_outline_24, "Downloaded") R.drawable.netflix_pause,
R.string.downloading
)
else -> Pair(R.drawable.ic_baseline_delete_outline_24, R.string.downloaded)
} }
} else { } 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) { 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
}
} }
} }

View File

@ -19,6 +19,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.APIHolder.apis import com.lagradost.cloudstream3.APIHolder.apis
import com.lagradost.cloudstream3.MainActivity.Companion.backEvent 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.Resource
import com.lagradost.cloudstream3.mvvm.observe import com.lagradost.cloudstream3.mvvm.observe
import com.lagradost.cloudstream3.ui.AutofitRecyclerView import com.lagradost.cloudstream3.ui.AutofitRecyclerView
@ -95,6 +96,8 @@ class HomeFragment : Fragment() {
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
context?.updateLocale()
homeViewModel = homeViewModel =
ViewModelProvider(this).get(HomeViewModel::class.java) ViewModelProvider(this).get(HomeViewModel::class.java)

View File

@ -68,6 +68,7 @@ import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.MainActivity.Companion.canEnterPipMode import com.lagradost.cloudstream3.MainActivity.Companion.canEnterPipMode
import com.lagradost.cloudstream3.MainActivity.Companion.isInPIPMode import com.lagradost.cloudstream3.MainActivity.Companion.isInPIPMode
import com.lagradost.cloudstream3.MainActivity.Companion.showToast import com.lagradost.cloudstream3.MainActivity.Companion.showToast
import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.mvvm.Resource import com.lagradost.cloudstream3.mvvm.Resource
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
@ -948,6 +949,8 @@ class PlayerFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
context?.let { ctx -> context?.let { ctx ->
ctx.updateLocale()
setPreferredSubLanguage(ctx.getAutoSelectLanguageISO639_1()) setPreferredSubLanguage(ctx.getAutoSelectLanguageISO639_1())
} }
@ -2045,6 +2048,8 @@ class PlayerFragment : Fragment() {
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
context?.updateLocale()
return inflater.inflate(R.layout.fragment_player, container, false) return inflater.inflate(R.layout.fragment_player, container, false)
} }
} }

View File

@ -32,6 +32,7 @@ import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.APIHolder.getApiFromName import com.lagradost.cloudstream3.APIHolder.getApiFromName
import com.lagradost.cloudstream3.APIHolder.getId import com.lagradost.cloudstream3.APIHolder.getId
import com.lagradost.cloudstream3.MainActivity.Companion.showToast 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.Resource
import com.lagradost.cloudstream3.mvvm.observe import com.lagradost.cloudstream3.mvvm.observe
import com.lagradost.cloudstream3.ui.WatchType import com.lagradost.cloudstream3.ui.WatchType
@ -168,6 +169,8 @@ class ResultFragment : Fragment() {
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle?, savedInstanceState: Bundle?,
): View? { ): View? {
context?.updateLocale()
viewModel = viewModel =
ViewModelProvider(activity ?: this).get(ResultViewModel::class.java) ViewModelProvider(activity ?: this).get(ResultViewModel::class.java)
return inflater.inflate(R.layout.fragment_result, container, false) return inflater.inflate(R.layout.fragment_result, container, false)

View File

@ -21,6 +21,7 @@ import com.lagradost.cloudstream3.APIHolder.apis
import com.lagradost.cloudstream3.APIHolder.getApiSettings import com.lagradost.cloudstream3.APIHolder.getApiSettings
import com.lagradost.cloudstream3.APIHolder.getApiTypeSettings import com.lagradost.cloudstream3.APIHolder.getApiTypeSettings
import com.lagradost.cloudstream3.HomePageList import com.lagradost.cloudstream3.HomePageList
import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.TvType import com.lagradost.cloudstream3.TvType
import com.lagradost.cloudstream3.mvvm.Resource import com.lagradost.cloudstream3.mvvm.Resource
@ -47,6 +48,8 @@ class SearchFragment : Fragment() {
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle?, savedInstanceState: Bundle?,
): View? { ): View? {
context?.updateLocale()
searchViewModel = searchViewModel =
ViewModelProvider(this).get(SearchViewModel::class.java) ViewModelProvider(this).get(SearchViewModel::class.java)
activity?.window?.setSoftInputMode( activity?.window?.setSoftInputMode(

View File

@ -7,6 +7,7 @@ import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import com.lagradost.cloudstream3.MainActivity.Companion.setLocale import com.lagradost.cloudstream3.MainActivity.Companion.setLocale
import com.lagradost.cloudstream3.MainActivity.Companion.showToast import com.lagradost.cloudstream3.MainActivity.Companion.showToast
import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.ui.subtitles.SubtitlesFragment import com.lagradost.cloudstream3.ui.subtitles.SubtitlesFragment
@ -20,6 +21,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
var count = 0 var count = 0
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
context?.updateLocale()
hideKeyboard() hideKeyboard()
setPreferencesFromResource(R.xml.settings, rootKey) setPreferencesFromResource(R.xml.settings, rootKey)
val updatePreference = findPreference<Preference>(getString(R.string.manual_check_update_key))!! val updatePreference = findPreference<Preference>(getString(R.string.manual_check_update_key))!!

View File

@ -22,6 +22,7 @@ import com.google.android.exoplayer2.ui.CaptionStyleCompat
import com.jaredrummler.android.colorpicker.ColorPickerDialog import com.jaredrummler.android.colorpicker.ColorPickerDialog
import com.lagradost.cloudstream3.MainActivity import com.lagradost.cloudstream3.MainActivity
import com.lagradost.cloudstream3.MainActivity.Companion.showToast import com.lagradost.cloudstream3.MainActivity.Companion.showToast
import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.utils.DataStore.getKey import com.lagradost.cloudstream3.utils.DataStore.getKey
import com.lagradost.cloudstream3.utils.DataStore.setKey import com.lagradost.cloudstream3.utils.DataStore.setKey
@ -174,6 +175,7 @@ class SubtitlesFragment : Fragment() {
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle?, savedInstanceState: Bundle?,
): View? { ): View? {
context?.updateLocale()
return inflater.inflate(R.layout.subtitle_settings, container, false) return inflater.inflate(R.layout.subtitle_settings, container, false)
} }

View File

@ -9,7 +9,9 @@ import androidx.core.view.marginLeft
import androidx.core.view.marginRight import androidx.core.view.marginRight
import androidx.core.view.marginTop import androidx.core.view.marginTop
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.lagradost.cloudstream3.MainActivity.Companion.updateLocale
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog
object SingleSelectionHelper { object SingleSelectionHelper {
fun Context.showDialog( fun Context.showDialog(
@ -22,6 +24,8 @@ object SingleSelectionHelper {
callback: (List<Int>) -> Unit, callback: (List<Int>) -> Unit,
dismissCallback: () -> Unit dismissCallback: () -> Unit
) { ) {
this.updateLocale()
val realShowApply = showApply || isMultiSelect val realShowApply = showApply || isMultiSelect
val listView = dialog.findViewById<ListView>(R.id.listview1)!! val listView = dialog.findViewById<ListView>(R.id.listview1)!!
val textView = dialog.findViewById<TextView>(R.id.text1)!! val textView = dialog.findViewById<TextView>(R.id.text1)!!
@ -96,6 +100,8 @@ object SingleSelectionHelper {
dismissCallback: () -> Unit, dismissCallback: () -> Unit,
callback: (List<Int>) -> Unit, callback: (List<Int>) -> Unit,
) { ) {
this.updateLocale()
val builder = val builder =
AlertDialog.Builder(this, R.style.AlertDialogCustom).setView(R.layout.bottom_selection_dialog) AlertDialog.Builder(this, R.style.AlertDialogCustom).setView(R.layout.bottom_selection_dialog)
@ -112,6 +118,8 @@ object SingleSelectionHelper {
dismissCallback: () -> Unit, dismissCallback: () -> Unit,
callback: (Int) -> Unit, callback: (Int) -> Unit,
) { ) {
this.updateLocale()
val builder = val builder =
AlertDialog.Builder(this, R.style.AlertDialogCustom).setView(R.layout.bottom_selection_dialog) AlertDialog.Builder(this, R.style.AlertDialogCustom).setView(R.layout.bottom_selection_dialog)
@ -137,6 +145,8 @@ object SingleSelectionHelper {
dismissCallback: () -> Unit, dismissCallback: () -> Unit,
callback: (Int) -> Unit, callback: (Int) -> Unit,
) { ) {
this.updateLocale()
val builder = val builder =
BottomSheetDialog(this) BottomSheetDialog(this)
builder.setContentView(R.layout.bottom_selection_dialog) builder.setContentView(R.layout.bottom_selection_dialog)

View File

@ -263,12 +263,13 @@ object VideoDownloadManager {
val rowTwoExtra = if (ep.name != null) " - ${ep.name}\n" else "" val rowTwoExtra = if (ep.name != null) " - ${ep.name}\n" else ""
val rowTwo = if (ep.season != null && ep.episode != null) { 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) { } else if (ep.episode != null) {
"Episode ${ep.episode}" + rowTwoExtra "${context.getString(R.string.episode)} ${ep.episode}" + rowTwoExtra
} else { } else {
(ep.name ?: "") + "" (ep.name ?: "") + ""
} }
val downloadFormat = context.getString(R.string.download_format)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (ep.poster != null) { if (ep.poster != null) {
@ -282,16 +283,15 @@ object VideoDownloadManager {
val progressPercentage = progress * 100 / total val progressPercentage = progress * 100 / total
val progressMbString = "%.1f".format(progress / 1000000f) val progressMbString = "%.1f".format(progress / 1000000f)
val totalMbString = "%.1f".format(total / 1000000f) val totalMbString = "%.1f".format(total / 1000000f)
val bigText = val bigText =
if (state == DownloadType.IsDownloading || state == DownloadType.IsPaused) { if (state == DownloadType.IsDownloading || state == DownloadType.IsPaused) {
(if (linkName == null) "" else "$linkName\n") + "$rowTwo\n$progressPercentage % ($progressMbString MB/$totalMbString MB)" (if (linkName == null) "" else "$linkName\n") + "$rowTwo\n$progressPercentage % ($progressMbString MB/$totalMbString MB)"
} else if (state == DownloadType.IsFailed) { } else if (state == DownloadType.IsFailed) {
"Download Failed - $rowTwo" downloadFormat.format(context.getString(R.string.download_failed), rowTwo)
} else if (state == DownloadType.IsDone) { } else if (state == DownloadType.IsDone) {
"Download Done - $rowTwo" downloadFormat.format(context.getString(R.string.download_done), rowTwo)
} else { } else {
"Download Canceled - $rowTwo" downloadFormat.format(context.getString(R.string.download_canceled), rowTwo)
} }
val bodyStyle = NotificationCompat.BigTextStyle() val bodyStyle = NotificationCompat.BigTextStyle()
@ -301,11 +301,11 @@ object VideoDownloadManager {
val txt = if (state == DownloadType.IsDownloading || state == DownloadType.IsPaused) { val txt = if (state == DownloadType.IsDownloading || state == DownloadType.IsPaused) {
rowTwo rowTwo
} else if (state == DownloadType.IsFailed) { } else if (state == DownloadType.IsFailed) {
"Download Failed - $rowTwo" downloadFormat.format(context.getString(R.string.download_failed), rowTwo)
} else if (state == DownloadType.IsDone) { } else if (state == DownloadType.IsDone) {
"Download Done - $rowTwo" downloadFormat.format(context.getString(R.string.download_done), rowTwo)
} else { } else {
"Download Canceled - $rowTwo" downloadFormat.format(context.getString(R.string.download_canceled), rowTwo)
} }
builder.setContentText(txt) builder.setContentText(txt)
@ -352,9 +352,9 @@ object VideoDownloadManager {
DownloadActionType.Pause -> pressToPauseIcon DownloadActionType.Pause -> pressToPauseIcon
DownloadActionType.Stop -> pressToStopIcon DownloadActionType.Stop -> pressToStopIcon
}, when (i) { }, when (i) {
DownloadActionType.Resume -> "Resume" DownloadActionType.Resume -> context.getString(R.string.resume)
DownloadActionType.Pause -> "Pause" DownloadActionType.Pause -> context.getString(R.string.pause)
DownloadActionType.Stop -> "Cancel" DownloadActionType.Stop -> context.getString(R.string.cancel)
}, pending }, pending
) )
) )
@ -1278,7 +1278,7 @@ object VideoDownloadManager {
link: ExtractorLink, link: ExtractorLink,
tryResume: Boolean = false, tryResume: Boolean = false,
): Int { ): 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")) { if (link.isM3u8 || link.url.endsWith(".m3u8")) {
val startIndex = if (tryResume) { val startIndex = if (tryResume) {
@ -1413,7 +1413,11 @@ object VideoDownloadManager {
main { main {
showToast( // can be replaced with regular Toast showToast( // can be replaced with regular Toast
context, 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 Toast.LENGTH_SHORT
) )
} }

View File

@ -100,7 +100,7 @@
android:id="@+id/download_child_episode_download" android:id="@+id/download_child_episode_download"
android:background="?selectableItemBackgroundBorderless" android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_play_arrow_24" android:src="@drawable/ic_baseline_play_arrow_24"
android:contentDescription="@string/download_descript"/> android:contentDescription="@string/download"/>
</FrameLayout> </FrameLayout>
</GridLayout> </GridLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View File

@ -60,7 +60,7 @@
android:id="@+id/download_header_goto_child" android:id="@+id/download_header_goto_child"
android:layout_gravity="center_vertical|end" android:layout_gravity="center_vertical|end"
android:src="@drawable/ic_baseline_keyboard_arrow_right_24" android:src="@drawable/ic_baseline_keyboard_arrow_right_24"
android:contentDescription="@string/download_descript"/> android:contentDescription="@string/download"/>
<FrameLayout <FrameLayout
android:layout_marginStart="-50dp" android:layout_marginStart="-50dp"
@ -94,7 +94,7 @@
android:id="@+id/download_header_episode_download" android:id="@+id/download_header_episode_download"
android:background="?selectableItemBackgroundBorderless" android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_play_arrow_24" android:src="@drawable/ic_baseline_play_arrow_24"
android:contentDescription="@string/download_descript"/> android:contentDescription="@string/download"/>
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View File

@ -93,7 +93,7 @@
android:id="@+id/result_episode_download" android:id="@+id/result_episode_download"
android:background="?selectableItemBackgroundBorderless" android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_play_arrow_24" android:src="@drawable/ic_baseline_play_arrow_24"
android:contentDescription="@string/download_descript"/> android:contentDescription="@string/download"/>
</FrameLayout> </FrameLayout>
</GridLayout> </GridLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View File

@ -108,7 +108,7 @@
android:id="@+id/result_episode_download" android:id="@+id/result_episode_download"
android:background="?selectableItemBackgroundBorderless" android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_play_arrow_24" android:src="@drawable/ic_baseline_play_arrow_24"
android:contentDescription="@string/download_descript"/> android:contentDescription="@string/download"/>
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
<TextView <TextView

View File

@ -40,7 +40,7 @@
<string name="episode_poster">Πόστερ</string> <string name="episode_poster">Πόστερ</string>
<string name="play_episode">Αναπαραγωγή Επισοδείου</string> <string name="play_episode">Αναπαραγωγή Επισοδείου</string>
<string name="need_storage">Δώσε άδεια για την λήψη επισοδείου</string> <string name="need_storage">Δώσε άδεια για την λήψη επισοδείου</string>
<string name="download_descript">Λήξη</string> <string name="download">Λήξη</string>
<string name="error_loading_links_toast">Σφάλμα φόρτωσεις συνδέσμων</string> <string name="error_loading_links_toast">Σφάλμα φόρτωσεις συνδέσμων</string>
<string name="download_storage_text">Εσωτερικός χώρος</string> <string name="download_storage_text">Εσωτερικός χώρος</string>
<string name="options">Επιλογές</string> <string name="options">Επιλογές</string>

View File

@ -40,7 +40,7 @@
<string name="episode_poster">Afleveringsposter</string> <string name="episode_poster">Afleveringsposter</string>
<string name="play_episode">Aflevering afspelen</string> <string name="play_episode">Aflevering afspelen</string>
<string name="need_storage">Toestaan om afleveringen te downloaden</string> <string name="need_storage">Toestaan om afleveringen te downloaden</string>
<string name="download_descript">Download</string> <string name="download">Download</string>
<string name="error_loading_links_toast">Fout bij laden van links</string> <string name="error_loading_links_toast">Fout bij laden van links</string>
<string name="download_storage_text">Interne opslag</string> <string name="download_storage_text">Interne opslag</string>
<string name="options">Opties</string> <string name="options">Opties</string>

View File

@ -2,11 +2,12 @@
<resources> <resources>
<string name="rated_format">Betygsatt: %.1f</string> <string name="rated_format">Betygsatt: %.1f</string>
<string name="player_speed_text_format">Hastighet (%.2fx)</string> <string name="player_speed_text_format">Hastighet (%.2fx)</string>
<string name="new_update_format">Ny uppdatering hittad!\n%s -> %s</string>
<string name="app_name">CloudStream</string> <string name="app_name">CloudStream</string>
<string name="title_home">Hem</string> <string name="title_home">Hem</string>
<string name="title_search">Sök</string> <string name="title_search">Sök</string>
<string name="title_downloads">Nerladdningar</string> <string name="title_downloads">Nedladdningar</string>
<string name="title_settings">Instälningar</string> <string name="title_settings">Instälningar</string>
<string name="search_hint">Sök…</string> <string name="search_hint">Sök…</string>
<string name="change_providers_des">Ändra Providers</string> <string name="change_providers_des">Ändra Providers</string>
@ -33,23 +34,21 @@
<string name="play_movie_button">Spela Upp</string> <string name="play_movie_button">Spela Upp</string>
<string name="play_torrent_button">Strömma Torrent</string> <string name="play_torrent_button">Strömma Torrent</string>
<string name="pick_source">Sources</string> <string name="pick_source">Källor</string>
<string name="pick_subtitle">Undertexter</string> <string name="pick_subtitle">Undertexter</string>
<string name="reload_error">Försök ansluta igen…</string> <string name="reload_error">Försök ansluta igen…</string>
<string name="result_go_back">Gå tillbaka</string> <string name="result_go_back">Gå tillbaka</string>
<string name="episode_poster">@string/result_poster</string> <string name="episode_poster">@string/result_poster</string>
<string name="play_episode">Spela Avsnitt</string> <string name="play_episode">Spela Avsnitt</string>
<string name="need_storage">Allow to download episodes</string> <string name="need_storage">Allow to download episodes</string>
<string name="download_descript">Ladda ner</string> <string name="download">Ladda ner</string>
<string name="download_storage_text">Intern lagring</string> <string name="download_storage_text">Intern lagring</string>
<string name="app_dubbed_text">Dub</string> <string name="app_dubbed_text">Dub</string>
<string name="app_subbed_text">Sub</string> <string name="app_subbed_text">Sub</string>
<string name="popup_delete_file">Radera</string> <string name="popup_delete_file">Ta bort</string>
<string name="popup_play_file">Spela upp</string> <string name="popup_play_file">Spela upp</string>
<string name="popup_resume_download">Resume Download</string>
<string name="popup_pause_download">Pause Download</string>
<string name="pref_disable_acra">Inaktivera automatisk felrapportering</string> <string name="pref_disable_acra">Inaktivera automatisk felrapportering</string>
<string name="home_more_info">Mer information</string> <string name="home_more_info">Mer information</string>
@ -82,7 +81,7 @@
<string name="prerelease_commit_hash">unknown_prerelease</string> <string name="prerelease_commit_hash">unknown_prerelease</string>
<string name="subs_auto_select_language">Autoval av undertextspråk</string> <string name="subs_auto_select_language">Autoval av undertextspråk</string>
<string name="subs_download_languages">Automatisk nerladdaning av språk</string> <string name="subs_download_languages">Automatisk nedladdaning av språk</string>
<string name="subs_hold_to_reset_to_default">Håll inne för att återställa till standard</string> <string name="subs_hold_to_reset_to_default">Håll inne för att återställa till standard</string>
<string name="continue_watching">Fortsätt titta</string> <string name="continue_watching">Fortsätt titta</string>
@ -133,7 +132,7 @@
<string name="no_links_found_toast">Inga länkar hittades</string> <string name="no_links_found_toast">Inga länkar hittades</string>
<string name="copy_link_toast">Länken kopierades till urklipp</string> <string name="copy_link_toast">Länken kopierades till urklipp</string>
<string name="play_episode_toast">Spela upp avsnitt</string> <string name="play_episode_toast">Spela upp avsnitt</string>
<string name="subs_default_reset_toast">Återställ till standardvärdet</string> <string name="subs_default_reset_toast">Återställd till standardvärdet</string>
<string name="acra_report_toast">Programmet kraschade tyvärr. En anonym felrapport kommer att skickas till utvecklarna</string> <string name="acra_report_toast">Programmet kraschade tyvärr. En anonym felrapport kommer att skickas till utvecklarna</string>
<string name="error_loading_links_toast">Fel uppstod vid laddning av länkarna</string> <string name="error_loading_links_toast">Fel uppstod vid laddning av länkarna</string>
@ -144,7 +143,7 @@
<string name="season_short">S</string> <string name="season_short">S</string>
<string name="episode_short">A</string> <string name="episode_short">A</string>
<string name="delete_file">Ta bort nerladdad fil</string> <string name="delete_file">Ta bort nedladdad fil</string>
<string name="delete">Ta bort</string> <string name="delete">Ta bort</string>
<string name="delete_message">Denna fil kommer att raderas permanent %s\nÄr du helt säker?</string> <string name="delete_message">Denna fil kommer att raderas permanent %s\nÄr du helt säker?</string>
@ -190,7 +189,18 @@
<string name="skip_op">Hoppa över OP</string> <string name="skip_op">Hoppa över OP</string>
<string name="dont_show_again">Visa inte igen</string> <string name="dont_show_again">Visa inte igen</string>
<string name="download_started">Nerladdning startad</string>
<string name="download_failed">Nerladdning Misslyckades</string>
<string name="update">Uppdatering</string> <string name="update">Uppdatering</string>
<string name="download_started">Nedladdningar startad</string>
<string name="download_failed">Nedladdning Misslyckades</string>
<string name="downloaded">Nedladdad</string>
<string name="downloading">Laddar ner</string>
<string name="download_paused">Nedladdning Pausad</string>
<string name="download_canceled">Nedladdning Avbryten</string>
<string name="download_done">Nedladdning Färdig</string>
<string name="popup_resume_download">Återupta nedladdning</string>
<string name="popup_pause_download">Pausa nedladdning</string>
<string name="pause">Pausa</string>
<string name="resume">Återuppta</string>
</resources> </resources>

View File

@ -61,7 +61,17 @@
<string name="episode_poster">Episode Poster</string> <string name="episode_poster">Episode Poster</string>
<string name="play_episode">Play Episode</string> <string name="play_episode">Play Episode</string>
<string name="need_storage">Allow to download episodes</string> <string name="need_storage">Allow to download episodes</string>
<string name="download_descript">Download</string>
<string name="download">Download</string>
<string name="downloaded">Downloaded</string>
<string name="downloading">Downloading</string>
<string name="download_paused">Download Paused</string>
<string name="download_started">Download Started</string>
<string name="download_failed">Download Failed</string>
<string name="download_canceled">Download Canceled</string>
<string name="download_done">Download Done</string>
<string name="download_format" translatable="false">%s - %s</string>
<string name="error_loading_links_toast">Error Loading Links</string> <string name="error_loading_links_toast">Error Loading Links</string>
<string name="download_storage_text">Internal Storage</string> <string name="download_storage_text">Internal Storage</string>
@ -170,6 +180,8 @@
<string name="delete_file">Delete File</string> <string name="delete_file">Delete File</string>
<string name="delete">Delete</string> <string name="delete">Delete</string>
<string name="cancel" translatable="false">@string/sort_cancel</string> <string name="cancel" translatable="false">@string/sort_cancel</string>
<string name="pause">Pause</string>
<string name="resume">Resume</string>
<string name="delete_message">This will permanently delete %s\nAre you sure?</string> <string name="delete_message">This will permanently delete %s\nAre you sure?</string>
<string name="status_ongoing">Ongoing</string> <string name="status_ongoing">Ongoing</string>
@ -219,7 +231,5 @@
<string name="skip_op">Skip OP</string> <string name="skip_op">Skip OP</string>
<string name="dont_show_again">Don\'t show again</string> <string name="dont_show_again">Don\'t show again</string>
<string name="download_started">Download started</string>
<string name="download_failed">Download Failed</string>
<string name="update">Update</string> <string name="update">Update</string>
</resources> </resources>