Implement language switcher (#563)

* Implement language switching using BaseActivity

* Add requested changes

* Cleanup App.kt Imports and add pref_language_key

* Acutally use @string for key

* Use string resource for language preference title
This commit is contained in:
Ken Swenson
2016-12-13 14:47:46 -05:00
committed by inorichi
parent 4061c7450b
commit cc9fd53abb
12 changed files with 114 additions and 0 deletions

View File

@@ -2,10 +2,12 @@ package eu.kanade.tachiyomi
import android.app.Application
import android.content.Context
import android.content.res.Configuration
import android.support.multidex.MultiDex
import com.evernote.android.job.JobManager
import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
import eu.kanade.tachiyomi.data.updater.UpdateCheckerJob
import eu.kanade.tachiyomi.util.LocaleHelper
import org.acra.ACRA
import org.acra.annotation.ReportsCrashes
import timber.log.Timber
@@ -31,6 +33,8 @@ open class App : Application() {
setupAcra()
setupJobManager()
LocaleHelper.updateCfg(this, baseContext.resources.configuration)
}
override fun attachBaseContext(base: Context) {
@@ -40,6 +44,11 @@ open class App : Application() {
}
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
LocaleHelper.updateCfg(this, newConfig)
}
protected open fun setupAcra() {
ACRA.init(this)
}