update todo

This commit is contained in:
Helium314 2025-02-25 21:36:30 +01:00
parent 987f0560d9
commit 93e6f88f6c
2 changed files with 4 additions and 9 deletions

View file

@ -177,12 +177,6 @@ data class SettingsSubtype(val locale: Locale, val extraValues: String) {
it == ExtraValue.ASCII_CAPABLE
|| it == ExtraValue.EMOJI_CAPABLE
|| it == ExtraValue.IS_ADDITIONAL_SUBTYPE
// todo: UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME is in "old" additional subtypes, but where was it set?
// must have been done by 2.3, can't find it being done explicitly
// anyway, a. we can easily create it again, and b. it may contain "bad" characters messing up the extra value
// see also todo at createAdditionalSubtype
// removing UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME changes the name of some layouts,
// e.g. from "English (United States)" to "English (US)"
|| it.startsWith(ExtraValue.UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME)
}.joinToString(",")
require(!filteredExtraValue.contains(Separators.SETS) && !filteredExtraValue.contains(Separators.SET))

View file

@ -20,9 +20,6 @@ object SubtypeUtilsAdditional {
return subtype.containsExtraValueKey(ExtraValue.IS_ADDITIONAL_SUBTYPE)
}
// todo: extra value does not contain UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME for custom layout
// it did contain that key in 2.3, but where was it set? anyway, need to be careful with separators if we want to use it
// see also todo in SettingsSubtype
fun createAdditionalSubtype(locale: Locale, extraValue: String, isAsciiCapable: Boolean,
isEmojiCapable: Boolean): InputMethodSubtype {
val mainLayoutName = LayoutType.getMainLayoutFromExtraValue(extraValue) ?: "qwerty"
@ -157,6 +154,10 @@ object SubtypeUtilsAdditional {
if (isAsciiCapable)
extraValueItems.add(ExtraValue.ASCII_CAPABLE)
if (SubtypeLocaleUtils.isExceptionalLocale(locale)) {
// this seems to be for shorter names (e.g. English (US) instead English (United States))
// but is now also used for languages that are not known by Android (at least older versions)
// todo: actually this should never contain a custom layout name, because it may contain any
// characters including , and = which may break extra values
extraValueItems.add(
ExtraValue.UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME + "=" + SubtypeLocaleUtils.getMainLayoutDisplayName(mainLayoutName)
)