Skip to content

Commit

Permalink
fix: imperfect application of LocaleUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Jun 27, 2021
1 parent 363908e commit b1a5e82
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/com/osfans/trime/ime/core/Trime.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,12 @@ public void onCreate() {
s = mConfig.getString("locale");
if (Function.isEmpty(s)) s = "";
locales[0] = LocaleUtils.INSTANCE.stringToLocale(s);
if (locales[0].equals(new Locale(s))) locales[0] = Locale.getDefault();

s = mConfig.getString("latin_locale");
if (Function.isEmpty(s)) s = "en";
if (Function.isEmpty(s)) s = "en_US";
locales[1] = LocaleUtils.INSTANCE.stringToLocale(s);
if (locales[1].equals(new Locale("en"))) locales[0] = Locale.ENGLISH;
if (locales[1].equals(new Locale(s))) locales[0] = Locale.ENGLISH;
/*
String[] ss;
s = mConfig.getString("locale");
Expand All @@ -323,7 +324,7 @@ public void onCreate() {
if (ss.length == 1) locales[1] = new Locale(ss[0]);
else if (ss.length == 2) locales[1] = new Locale(ss[0], ss[1]);
else if (ss.length == 3) locales[1] = new Locale(ss[0], ss[1], ss[2]);
else locales[0] = Locale.ENGLISH; */
else locales[0] = Locale.ENGLISH;*/

orientation = getResources().getConfiguration().orientation;
// Use the following line to debug IME service.
Expand Down

0 comments on commit b1a5e82

Please sign in to comment.