添加应用内语言切换

pull/306/head
gedoor 4 years ago
parent 7b93bf6e25
commit 3552ced2ee
  1. 1
      app/src/main/java/io/legado/app/App.kt
  2. 1
      app/src/main/java/io/legado/app/help/storage/Restore.kt
  3. 1
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt

@ -43,6 +43,7 @@ class App : MultiDexApplication() {
super.onCreate() super.onCreate()
INSTANCE = this INSTANCE = this
CrashHandler().init(this) CrashHandler().init(this)
LanguageUtils.setConfiguration(this)
db = AppDatabase.createDatabase(INSTANCE) db = AppDatabase.createDatabase(INSTANCE)
packageManager.getPackageInfo(packageName, 0)?.let { packageManager.getPackageInfo(packageName, 0)?.let {
versionCode = it.versionCode versionCode = it.versionCode

@ -188,6 +188,7 @@ object Restore {
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
LauncherIconHelp.changeIcon(App.INSTANCE.getPrefString(PreferKey.launcherIcon)) LauncherIconHelp.changeIcon(App.INSTANCE.getPrefString(PreferKey.launcherIcon))
} }
LanguageUtils.setConfiguration(App.INSTANCE)
App.INSTANCE.applyDayNight() App.INSTANCE.applyDayNight()
postEvent(EventBus.SHOW_RSS, "") postEvent(EventBus.SHOW_RSS, "")
postEvent(EventBus.RECREATE, "") postEvent(EventBus.RECREATE, "")

@ -118,6 +118,7 @@ class OtherConfigFragment : BasePreferenceFragment(),
PreferKey.replaceEnableDefault -> AppConfig.replaceEnableDefault = PreferKey.replaceEnableDefault -> AppConfig.replaceEnableDefault =
App.INSTANCE.getPrefBoolean(PreferKey.replaceEnableDefault, true) App.INSTANCE.getPrefBoolean(PreferKey.replaceEnableDefault, true)
PreferKey.language -> { PreferKey.language -> {
LanguageUtils.setConfiguration(App.INSTANCE)
postEvent(EventBus.RECREATE, "") postEvent(EventBus.RECREATE, "")
} }
} }

Loading…
Cancel
Save