Remove en-GB option since we don't actually localize different English locales

(cherry picked from commit 0cb042cd93d5bd2ad249a71af7d7bf87da5a6a89)

# Conflicts:
#	app/build.gradle.kts
This commit is contained in:
arkon 2021-07-02 09:02:28 -04:00 committed by Jobobby04
parent ad2bbd0e3c
commit aa23de77bc
5 changed files with 12 additions and 4 deletions

View File

@ -229,6 +229,11 @@ object Migrations {
putString(PreferenceKeys.librarySortingDirection, newSortingDirection.name) putString(PreferenceKeys.librarySortingDirection, newSortingDirection.name)
} }
} }
if (oldVersion < 65) {
if (preferences.lang().get() in listOf("en-US", "en-GB")) {
preferences.lang().set("en")
}
}
return true return true
} }

View File

@ -290,7 +290,7 @@ class PreferencesHelper(val context: Context) {
fun downloadNewCategories() = flowPrefs.getStringSet(Keys.downloadNewCategories, emptySet()) fun downloadNewCategories() = flowPrefs.getStringSet(Keys.downloadNewCategories, emptySet())
fun downloadNewCategoriesExclude() = flowPrefs.getStringSet(Keys.downloadNewCategoriesExclude, emptySet()) fun downloadNewCategoriesExclude() = flowPrefs.getStringSet(Keys.downloadNewCategoriesExclude, emptySet())
fun lang() = prefs.getString(Keys.lang, "") fun lang() = flowPrefs.getString(Keys.lang, "")
fun defaultCategory() = prefs.getInt(Keys.defaultCategory, -1) fun defaultCategory() = prefs.getInt(Keys.defaultCategory, -1)

View File

@ -191,8 +191,7 @@ class SettingsGeneralController : SettingsController() {
"eo", "eo",
"es", "es",
"es-419", "es-419",
"en-US", "en",
"en-GB",
"fa", "fa",
"fi", "fi",
"fil", "fil",

View File

@ -25,7 +25,7 @@ object LocaleHelper {
/** /**
* The application's locale. When it's null, the system locale is used. * The application's locale. When it's null, the system locale is used.
*/ */
private var appLocale = getLocaleFromString(preferences.lang()) private var appLocale = getLocaleFromString(preferences.lang().get())
/** /**
* The currently applied locale. Used to avoid losing the selected language after a non locale * The currently applied locale. Used to avoid losing the selected language after a non locale

View File

@ -329,6 +329,10 @@ object EXHMigrations {
if (oldVersion under 21) { if (oldVersion under 21) {
// Setup EH updater task after migrating to WorkManager // Setup EH updater task after migrating to WorkManager
EHentaiUpdateWorker.scheduleBackground(context) EHentaiUpdateWorker.scheduleBackground(context)
if (preferences.lang().get() in listOf("en-US", "en-GB")) {
preferences.lang().set("en")
}
} }
// if (oldVersion under 1) { } (1 is current release version) // if (oldVersion under 1) { } (1 is current release version)