Merge pull request #1622 from kiwix/feature/macgills/1620-read-aloud-enforced-language

#1620 "Read aloud" seems completly broken with `develop` branch
This commit is contained in:
Kelson 2019-12-09 01:17:13 +01:00 committed by GitHub
commit 1a918fdff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,9 @@ class CustomMainActivity : CoreMainActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
requireEnforcedLanguage()
if (enforcedLanguage()) {
return
}
openObbOrZim()
}
@ -112,7 +114,7 @@ class CustomMainActivity : CoreMainActivity() {
override fun getIconResId() = R.mipmap.ic_launcher
private fun requireEnforcedLanguage(): Boolean {
private fun enforcedLanguage(): Boolean {
val currentLocaleCode = Locale.getDefault().toString()
if (BuildConfig.ENFORCED_LANG.isNotEmpty() && BuildConfig.ENFORCED_LANG != currentLocaleCode) {
LanguageUtils.handleLocaleChange(this, BuildConfig.ENFORCED_LANG)