diff options
author | 2011-04-27 15:43:03 +0900 | |
---|---|---|
committer | 2011-04-27 16:11:34 +0900 | |
commit | 309bff562fbaf47488e6bf6636840f00574187d8 (patch) | |
tree | 05d2930c5a3583609541e1f9d1807c7c49510241 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 663d4f5cc1b08b6daf168d8ac3dcd56127036516 (diff) | |
download | latinime-309bff562fbaf47488e6bf6636840f00574187d8.tar.gz latinime-309bff562fbaf47488e6bf6636840f00574187d8.tar.xz latinime-309bff562fbaf47488e6bf6636840f00574187d8.zip |
Add a method to set the locale to Utils.
Add a setLocale method to Utils that returns the previous locale.
Also unify all calls through the code.
Change-Id: Ic850dc5df19fba00ed3601835652859b4321b544
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 28fd6aad7..175467fcb 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -470,14 +470,14 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final String localeStr = mSubtypeSwitcher.getInputLocaleStr(); final Locale keyboardLocale = new Locale(localeStr); - final Locale savedLocale = mSubtypeSwitcher.changeSystemLocale(keyboardLocale); + final Resources res = mResources; + final Locale savedLocale = Utils.setSystemLocale(res, keyboardLocale); if (mSuggest != null) { mSuggest.close(); } final SharedPreferences prefs = mPrefs; mQuickFixes = isQuickFixesEnabled(prefs); - final Resources res = mResources; int mainDicResId = Utils.getMainDictionaryResourceId(res); mSuggest = new Suggest(this, mainDicResId, keyboardLocale); loadAndSetAutoCorrectionThreshold(prefs); @@ -499,7 +499,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mWordSeparators = res.getString(R.string.word_separators); mSentenceSeparators = res.getString(R.string.sentence_separators); - mSubtypeSwitcher.changeSystemLocale(savedLocale); + Utils.setSystemLocale(res, savedLocale); } /* package private */ void resetSuggestMainDict() { |