improve layout for gujarati, fixes #417

This commit is contained in:
Helium314 2024-01-21 19:24:09 +01:00
parent 8601b841f2
commit bf05980349
3 changed files with 31 additions and 33 deletions

View file

@ -18,19 +18,19 @@
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "બ" },
"default": { "label": "ુ" }
"default": { "label": "ુ" }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ભ" },
"default": { "label": "ૂ" }
"default": { "label": "ૂ" }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "મ" },
"default": { "label": "ે" }
"default": { "label": "ે" }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ય" },
"default": { "label": "ૈ" }
"default": { "label": "ૈ" }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ર" },
@ -48,85 +48,82 @@
[
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "શ" },
"default": { "label": "", "popup": { "main": { "label": "" } } }
"default": { "label": "", "popup": { "main": { "label": "" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ષ" },
"default": { "label": "ક", "popup": { "main": { "label": "" } } }
"default": { "label": "ક", "popup": { "main": { "label": "" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "સ" },
"default": { "label": "ખ", "popup": { "main": { "label": "" } } }
"default": { "label": "ખ", "popup": { "main": { "label": "" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "હ" },
"default": { "label": "ગ", "popup": { "main": { "label": "" } } }
"default": { "label": "ગ", "popup": { "main": { "label": "" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ળ" },
"default": { "label": "ઘ", "popup": { "main": { "label": "" } } }
"default": { "label": "ઘ", "popup": { "main": { "label": "" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ક્ષ" },
"default": { "label": "ઙ", "popup": { "main": { "label": "" } } }
"manualOrLocked": { "label": "ક્ષ", "labelFlags": 128 },
"default": { "label": "ઙ", "popup": { "main": { "label": "" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "જ્ઞ" },
"default": { "label": "ચ", "popup": { "main": { "label": "" } } }
"manualOrLocked": { "label": "જ્ઞ", "labelFlags": 128 },
"default": { "label": "ચ", "popup": { "main": { "label": "ત્ર" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "આ" },
"default": { "label": "છ", "popup": { "main": { "label": "૿" } } }
"default": { "label": "છ", "popup": { "main": { "label": "ત્ત" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ઇ" },
"default": { "label": "જ", "popup": { "main": { "label": "ત્ર" } } }
"default": { "label": "જ", "popup": { "main": { "label": "દ્વ" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ઈ" },
"default": { "label": "ઝ", "popup": { "main": { "label": "શ્ર" } } }
"default": { "label": "ઝ", "popup": { "main": { "label": "દ્ધ" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ઉ" },
"default": { "label": "ઞ", "popup": { "main": { "label": "્ર" } } }
"default": { "label": "ઞ", "popup": { "main": { "label": "્ર" } } }
}
],
[
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ઊ" },
"default": { "label": "ટ", "popup": { "main": { "label": "શ્વ" } } }
"default": { "label": "ટ"}
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "એ" },
"default": { "label": "ઠ", "popup": { "main": { "label": "ત્ત" } } }
"default": { "label": "ઠ", "popup": { "main": { "label": "શ્ર" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ઐ" },
"default": { "label": "ડ", "popup": { "main": { "label": "દ્ર" } } }
"default": { "label": "ડ", "popup": { "main": { "label": "શ્વ" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ઓ" },
"default": { "label": "ઢ", "popup": { "main": { "label": "દ્" } } }
"default": { "label": "ઢ", "popup": { "main": { "label": "દ્" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ઔ" },
"default": { "label": "ણ", "popup": { "main": { "label": "દ્દ" } } }
"default": { "label": "ણ", "popup": { "main": { "label": "હ્ય" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "અં" },
"default": { "label": "ત", "popup": { "main": { "label": "દ્ય" } } }
"manualOrLocked": { "label": "અં", "labelFlags": 128 },
"default": { "label": "ત", "popup": { "main": { "label": "" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "અઃ" },
"default": { "label": "થ", "popup": { "main": { "label": "" } } }
"manualOrLocked": { "label": "અઃ", "labelFlags": 128 },
"default": { "label": "થ", "popup": { "main": { "label": "" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ૐ" },
"default": { "label": "દ", "popup": { "main": { "label": "" } } }
"default": { "label": "દ", "popup": { "main": { "label": "" } } }
},
{ "$": "shift_state_selector",
"manualOrLocked": { "label": "ૠ" },
"default": { "label": "્", "popup": { "main": { "label": "꠲" } } }
}
{ "label": "્", "popup": { "main": { "label": "૱" } } }
]
]

View file

@ -67,6 +67,7 @@ class LocaleKeyTexts(dataStream: InputStream?, locale: Locale) {
val colonSpaceRegex = ":\\s+".toRegex()
reader.forEachLine { l ->
val line = l.trim()
if (line.isEmpty()) return@forEachLine
when (line) {
"[morekeys]" -> { mode = READER_MODE_MORE_KEYS; return@forEachLine }
"[extra_keys]" -> { mode = READER_MODE_EXTRA_KEYS; return@forEachLine }
@ -284,7 +285,7 @@ private fun getCurrencyKey(locale: Locale): Pair<String, Array<String>> {
return genericCurrencyKey(getCurrency(locale))
if (locale.country != "IN" && locale.language == "ta")
return genericCurrencyKey("")
if (locale.country == "IN" || locale.language.matches("hi|kn|ml|mr|ta|te".toRegex()))
if (locale.country == "IN" || locale.language.matches("hi|kn|ml|mr|ta|te|gu".toRegex()))
return rupee
if (locale.country == "GB")
return pound

View file

@ -102,7 +102,7 @@ public final class PreferencesSettingsFragment extends SubScreenFragment {
final Preference pref = findPreference(Settings.PREF_LOCALIZED_NUMBER_ROW);
if (pref == null) return;
// locales that have a number row defined (not good to have it hardcoded, but reading a bunch of files may be noticeably slow)
final String[] numberRowLocales = new String[] { "ar", "bn", "fa", "hi", "mr", "ne", "ur" };
final String[] numberRowLocales = new String[] { "ar", "bn", "fa", "gu", "hi", "mr", "ne", "ur" };
for (final InputMethodSubtype subtype : SubtypeSettingsKt.getEnabledSubtypes(getSharedPreferences(), true)) {
if (ArraysKt.any(numberRowLocales, (l) -> l.equals(subtype.getLocale().substring(0, 2)))) {
pref.setVisible(true);