Skip to content
Snippets Groups Projects
Commit 95f0f771 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais
Browse files

Fix some language issues

(cherry picked from commit b469eb86)
parent 7d3dd4e1
No related branches found
No related tags found
No related merge requests found
......@@ -17,10 +17,7 @@ open class BaseActivity : AppCompatActivity(), CoroutineScope by MainScope() {
lateinit var settings: SharedPreferences
override fun onCreate(savedInstanceState: Bundle?) {
if (!localeSet) {
UiTools.setLocale(this)
localeSet = true
}
UiTools.setLocale(this)
settings = Settings.getInstance(this)
/* Theme must be applied before super.onCreate */
applyTheme()
......@@ -41,8 +38,4 @@ open class BaseActivity : AppCompatActivity(), CoroutineScope by MainScope() {
cancel()
super.onDestroy()
}
companion object {
var localeSet = false
}
}
......@@ -32,7 +32,6 @@ import androidx.preference.TwoStatePreference
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
import org.videolan.vlc.R
import org.videolan.vlc.gui.BaseActivity
import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.util.*
......@@ -100,7 +99,6 @@ class PreferencesUi : BasePreferenceFragment(), SharedPreferences.OnSharedPrefer
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
when (key) {
"set_locale" -> {
BaseActivity.localeSet = false
(activity as PreferencesActivity).setRestart()
UiTools.restartDialog(requireActivity())
}
......
......@@ -54,13 +54,9 @@ abstract class BaseTvActivity : FragmentActivity(), CoroutineScope by MainScope(
@Volatile
private var currentlyVisible = false
override fun onCreate(savedInstanceState: Bundle?) {
//Init Medialibrary if KO
if (!localeSet) {
UiTools.setLocale(this)
localeSet = true
}
UiTools.setLocale(this)
if (savedInstanceState != null) startMedialibrary(firstRun = false, upgrade = false, parse = true)
super.onCreate(savedInstanceState)
mediaLibrary = AbstractMedialibrary.getInstance()
......@@ -101,6 +97,7 @@ abstract class BaseTvActivity : FragmentActivity(), CoroutineScope by MainScope(
KeyHelper.manageModifiers(event)
return super.onKeyUp(keyCode, event)
}
protected abstract fun refresh()
protected open fun onParsingServiceStarted() {}
......@@ -123,8 +120,4 @@ abstract class BaseTvActivity : FragmentActivity(), CoroutineScope by MainScope(
MediaParsingService.newStorages.value = null
})
}
companion object {
var localeSet = false
}
}
......@@ -34,7 +34,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
import org.videolan.vlc.R
import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.gui.tv.browser.BaseTvActivity
import org.videolan.vlc.util.*
......@@ -73,7 +72,6 @@ class PreferencesUi : BasePreferenceFragment(), SharedPreferences.OnSharedPrefer
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
when (key) {
"set_locale" -> {
BaseTvActivity.localeSet = false
(activity as PreferencesActivity).setRestartApp()
UiTools.restartDialog(activity)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment