From 0cb042cd93d5bd2ad249a71af7d7bf87da5a6a89 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 2 Jul 2021 09:02:28 -0400 Subject: [PATCH] Remove en-GB option since we don't actually localize different English locales --- app/build.gradle.kts | 2 +- app/src/main/java/eu/kanade/tachiyomi/Migrations.kt | 5 +++++ .../eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt | 2 +- .../main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt | 2 +- .../kanade/tachiyomi/ui/setting/SettingsGeneralController.kt | 3 +-- .../java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 951d371c9..a7af50ff8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -30,7 +30,7 @@ android { minSdkVersion(AndroidConfig.minSdk) targetSdkVersion(AndroidConfig.targetSdk) testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - versionCode = 64 + versionCode = 65 versionName = "0.11.1" buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"") diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index afdcd30c8..21de124a8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -232,6 +232,11 @@ object Migrations { putString(PreferenceKeys.librarySortingDirection, newSortingDirection.name) } } + if (oldVersion < 65) { + if (preferences.lang().get() in listOf("en-US", "en-GB")) { + preferences.lang().set("en") + } + } return true } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt index bfd655940..21012a143 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt @@ -282,7 +282,7 @@ class PreferencesHelper(val context: Context) { fun downloadNewCategories() = flowPrefs.getStringSet(Keys.downloadNewCategories, 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) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt index eea057b54..8d9c669bd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt @@ -128,7 +128,7 @@ class LibraryItem( val tag = if (minus) { query.substringAfter("-") } else query return when (sourceName.contains(tag, true)) { false -> containsGenre(query, genres) - else -> !minus + else -> !minus } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt index 6f887eced..fa7799830 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt @@ -176,8 +176,7 @@ class SettingsGeneralController : SettingsController() { "eo", "es", "es-419", - "en-US", - "en-GB", + "en", "fa", "fi", "fil", diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt index d6ac453f8..f488234ef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt @@ -25,7 +25,7 @@ object LocaleHelper { /** * 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