mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-02 12:52:15 +00:00
don't show latin secondary locales for non-ascii-capable scripts
This commit is contained in:
parent
034ebe780f
commit
06c15da893
1 changed files with 6 additions and 3 deletions
|
@ -136,14 +136,17 @@ public final class SecondaryLocaleSettingsFragment extends SubScreenFragment {
|
|||
// get locales with same script as main locale, but different language
|
||||
private Set<String> getAvailableDictionaryLocales(String mainLocale, boolean asciiCapable) {
|
||||
final Locale mainL = LocaleUtils.constructLocaleFromString(mainLocale);
|
||||
final Set<String> locales = new HashSet<>();
|
||||
final int mainScript;
|
||||
if (asciiCapable)
|
||||
mainScript = ScriptUtils.SCRIPT_LATIN;
|
||||
else
|
||||
mainScript = ScriptUtils.getScriptFromSpellCheckerLocale(mainL);
|
||||
// TODO: does this really return latin for persian? might need that huge map from somewhere github
|
||||
|
||||
final Set<String> locales = new HashSet<>();
|
||||
// ScriptUtils.getScriptFromSpellCheckerLocale may return latin when it should not
|
||||
// e.g. for persian or chinese
|
||||
// workaround: don't allow secondary locales for these locales
|
||||
if (!asciiCapable && mainScript == ScriptUtils.SCRIPT_LATIN)
|
||||
return locales;
|
||||
|
||||
// TODO: also get locales from assets
|
||||
// need merged "compress" PR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue