1. seandroid
  2. Untitled project
  3. frameworks/base


Adam Powell  committed 732e589 Merge

am 6e8c1495: Merge "Re-read shortcut labels if the language has changed"

* commit '6e8c1495f6a65124750155409ce326736744a42b':
Re-read shortcut labels if the language has changed

  • Participants
  • Parent commits 3ee4740, 6e8c149
  • Branches master

Comments (0)

Files changed (1)

File core/java/com/android/internal/view/menu/MenuItemImpl.java

View file
  • Ignore whitespace
     private ContextMenuInfo mMenuInfo;
+    private static String sLanguage;
     private static String sPrependShortcutLabel;
     private static String sEnterShortcutLabel;
     private static String sDeleteShortcutLabel;
     MenuItemImpl(MenuBuilder menu, int group, int id, int categoryOrder, int ordering,
             CharSequence title, int showAsAction) {
-        if (sPrependShortcutLabel == null) {
+        String lang = menu.getContext().getResources().getConfiguration().locale.toString();
+        if (sPrependShortcutLabel == null || !lang.equals(sLanguage)) {
+            sLanguage = lang;
             // This is instantiated from the UI thread, so no chance of sync issues 
             sPrependShortcutLabel = menu.getContext().getResources().getString(