aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinKeyboard.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboard.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboard.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
index fbba55bad..1438d7da1 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
@@ -513,7 +513,7 @@ public class LatinKeyboard extends Keyboard {
final Rect bounds = new Rect();
// Estimate appropriate language name text size to fit in maxTextWidth.
- String language = LanguageSwitcher.toTitleCase(locale.getDisplayLanguage(locale));
+ String language = LanguageSwitcher.toTitleCase(locale.getDisplayLanguage(locale), locale);
int textWidth = getTextWidth(paint, language, origTextSize, bounds);
// Assuming text width and text size are proportional to each other.
float textSize = origTextSize * Math.min(maxTextWidth / textWidth, 1.0f);
@@ -529,7 +529,7 @@ public class LatinKeyboard extends Keyboard {
textSize = origTextSize;
}
if (useShortName) {
- language = LanguageSwitcher.toTitleCase(locale.getLanguage());
+ language = LanguageSwitcher.toTitleCase(locale.getLanguage(), locale);
textWidth = getTextWidth(paint, language, origTextSize, bounds);
textSize = origTextSize * Math.min(maxTextWidth / textWidth, 1.0f);
}
@@ -646,6 +646,10 @@ public class LatinKeyboard extends Keyboard {
setColorOfSymbolIcons(isAutoCompletion, isBlackSym);
}
+ public Locale getInputLocale() {
+ return (mLocale != null) ? mLocale : mLanguageSwitcher.getSystemLocale();
+ }
+
boolean isCurrentlyInSpace() {
return mCurrentlyInSpace;
}
@@ -955,7 +959,7 @@ public class LatinKeyboard extends Keyboard {
}
private String getLanguageName(Locale locale) {
- return LanguageSwitcher.toTitleCase(locale.getDisplayLanguage(locale));
+ return LanguageSwitcher.toTitleCase(locale.getDisplayLanguage(locale), locale);
}
@Override