mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-05 22:30:12 +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
|
// get locales with same script as main locale, but different language
|
||||||
private Set<String> getAvailableDictionaryLocales(String mainLocale, boolean asciiCapable) {
|
private Set<String> getAvailableDictionaryLocales(String mainLocale, boolean asciiCapable) {
|
||||||
final Locale mainL = LocaleUtils.constructLocaleFromString(mainLocale);
|
final Locale mainL = LocaleUtils.constructLocaleFromString(mainLocale);
|
||||||
|
final Set<String> locales = new HashSet<>();
|
||||||
final int mainScript;
|
final int mainScript;
|
||||||
if (asciiCapable)
|
if (asciiCapable)
|
||||||
mainScript = ScriptUtils.SCRIPT_LATIN;
|
mainScript = ScriptUtils.SCRIPT_LATIN;
|
||||||
else
|
else
|
||||||
mainScript = ScriptUtils.getScriptFromSpellCheckerLocale(mainL);
|
mainScript = ScriptUtils.getScriptFromSpellCheckerLocale(mainL);
|
||||||
// TODO: does this really return latin for persian? might need that huge map from somewhere github
|
// ScriptUtils.getScriptFromSpellCheckerLocale may return latin when it should not
|
||||||
|
// e.g. for persian or chinese
|
||||||
final Set<String> locales = new HashSet<>();
|
// workaround: don't allow secondary locales for these locales
|
||||||
|
if (!asciiCapable && mainScript == ScriptUtils.SCRIPT_LATIN)
|
||||||
|
return locales;
|
||||||
|
|
||||||
// TODO: also get locales from assets
|
// TODO: also get locales from assets
|
||||||
// need merged "compress" PR
|
// need merged "compress" PR
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue