diff --git a/app/src/main/java/helium314/keyboard/latin/common/LocaleUtils.kt b/app/src/main/java/helium314/keyboard/latin/common/LocaleUtils.kt index 6eca45a38..d8d99ead7 100644 --- a/app/src/main/java/helium314/keyboard/latin/common/LocaleUtils.kt +++ b/app/src/main/java/helium314/keyboard/latin/common/LocaleUtils.kt @@ -56,6 +56,8 @@ object LocaleUtils { // The compared locales are fully identical. This is the best match level. private const val LOCALE_FULL_MATCH = 30 + const val LOCALE_GOOD_MATCH = LOCALE_LANGUAGE_MATCH_COUNTRY_DIFFER; + /** * Return how well a tested locale matches a reference locale. * diff --git a/app/src/main/java/helium314/keyboard/latin/utils/DictionaryUtils.kt b/app/src/main/java/helium314/keyboard/latin/utils/DictionaryUtils.kt index 975e081fd..dc7ab32e2 100644 --- a/app/src/main/java/helium314/keyboard/latin/utils/DictionaryUtils.kt +++ b/app/src/main/java/helium314/keyboard/latin/utils/DictionaryUtils.kt @@ -76,7 +76,7 @@ fun createDictionaryTextHtml(message: String, locale: Locale, context: Context): // ideally the repo would switch to language tag, but not sure how this is handled in the dictionary header // further, the dicts in the dictionaries repo should be compatible with other AOSP-based keyboards val dictLocale = localeString.constructLocale() - if (LocaleUtils.getMatchLevel(locale, dictLocale) < 3) return@forEachLine + if (LocaleUtils.getMatchLevel(locale, dictLocale) < LocaleUtils.LOCALE_GOOD_MATCH) return@forEachLine val rawDictString = "$type: ${dictLocale.getDisplayName(context.resources.configuration.locale())}" val dictString = if (experimental.isEmpty()) rawDictString else context.getString(R.string.available_dictionary_experimental, rawDictString)