diff --git a/java/res/values-ar/donottranslate-more-keys.xml b/java/res/values-ar/donottranslate-more-keys.xml
index cde68608400cfaa06991f9268df2e159847691be..e49677adb72355b42aab77587512e131c10cd042 100644
--- a/java/res/values-ar/donottranslate-more-keys.xml
+++ b/java/res/values-ar/donottranslate-more-keys.xml
@@ -70,10 +70,8 @@
     <string name="keylabel_for_symbols_percent">\u066a</string>
     <string name="more_keys_for_comma">,</string>
     <string name="more_keys_for_f1">,</string>
-    <!-- @icon/3 is iconSettingsKey -->
-    <string name="more_keys_for_f1_settings">\\,,\@icon/3|\@integer/key_settings</string>
-    <!-- @icon/7 is iconTabKey -->
-    <string name="more_keys_for_f1_navigate">\\,,\@icon/7|\@integer/key_tab</string>
+    <string name="more_keys_for_f1_settings">\\,,\@icon/settingsKey|\@integer/key_settings</string>
+    <string name="more_keys_for_f1_navigate">\\,,\@icon/tabKey|\@integer/key_tab</string>
     <string name="more_keys_for_symbols_question">\?</string>
     <string name="more_keys_for_symbols_semicolon">;</string>
     <string name="more_keys_for_symbols_percent">%,‰</string>
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 9892d7835a0ff1cded73218fb0da20631b786ab7..57930c6756353321fecd1ddd9e248fb5da8cbac9 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -248,12 +248,10 @@
             <!-- This should be aligned with the KeyboardIcons.ICONS_TO_ATTRS_MAP -->
             <enum name="iconShiftKey" value="1" />
             <enum name="iconDeleteKey" value="2" />
-            <!-- This is also represented as "@icon/3" in keyboard layout XML. -->
             <enum name="iconSettingsKey" value="3" />
             <enum name="iconSpaceKey" value="4" />
             <enum name="iconReturnKey" value="5" />
             <enum name="iconSearchKey" value="6" />
-            <!-- This is also represented as "@icon/7" in keyboard layout XML. -->
             <enum name="iconTabKey" value="7" />
             <enum name="iconShortcutKey" value="8" />
             <enum name="iconShortcutForLabel" value="9" />
diff --git a/java/res/values/donottranslate-more-keys.xml b/java/res/values/donottranslate-more-keys.xml
index 3a3ea1e55240e787d4c031eb214cd9e81d53de7f..ce1538131a852b0d60ea0eddf07f82b88cc11b32 100644
--- a/java/res/values/donottranslate-more-keys.xml
+++ b/java/res/values/donottranslate-more-keys.xml
@@ -91,10 +91,8 @@
     <string name="keylabel_for_symbols_percent">%</string>
     <string name="more_keys_for_comma"></string>
     <string name="more_keys_for_f1"></string>
-    <!-- @icon/3 is iconSettingsKey -->
-    <string name="more_keys_for_f1_settings">\@icon/3|\@integer/key_settings</string>
-    <!-- @icon/7 is iconTabKey -->
-    <string name="more_keys_for_f1_navigate">\@icon/7|\@integer/key_tab</string>
+    <string name="more_keys_for_f1_settings">\@icon/settingsKey|\@integer/key_settings</string>
+    <string name="more_keys_for_f1_navigate">\@icon/tabKey|\@integer/key_tab</string>
     <string name="more_keys_for_symbols_question">¿</string>
     <string name="more_keys_for_symbols_semicolon"></string>
     <string name="more_keys_for_symbols_percent">‰</string>
diff --git a/java/res/xml-sw600dp/kbd_key_styles.xml b/java/res/xml-sw600dp/kbd_key_styles.xml
index ab90c9894f4670c0f38301cd0646d56e7aacca2e..abba592b76475c6649c1f452e82af9df9a711793 100644
--- a/java/res/xml-sw600dp/kbd_key_styles.xml
+++ b/java/res/xml-sw600dp/kbd_key_styles.xml
@@ -34,7 +34,7 @@
             <key-style
                 latin:styleName="f2PopupStyle"
                 latin:keyLabelFlags="hasPopupHint"
-                latin:moreKeys="\@icon/3|\@integer/key_settings"
+                latin:moreKeys="\@icon/settingsKey|\@integer/key_settings"
                 latin:backgroundType="functional" />
         </default>
     </switch>
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 6003d97231dc7ae67f1ee1e687ac68142c6e2ad7..3a9423f4bc5e1acdb697502250a85145fa1d05c9 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -166,7 +166,12 @@ public class Key {
     }
 
     private static Drawable getIcon(Keyboard.Params params, String moreKeySpec) {
-        return params.mIconsSet.getIconByIconId(MoreKeySpecParser.getIconId(moreKeySpec));
+        final int iconAttrId = MoreKeySpecParser.getIconAttrId(moreKeySpec);
+        if (iconAttrId == KeyboardIconsSet.ICON_UNDEFINED) {
+            return null;
+        } else {
+            return params.mIconsSet.getIconByAttrId(iconAttrId);
+        }
     }
 
     /**
@@ -277,12 +282,15 @@ public class Key {
                 R.styleable.Keyboard_Key_visualInsetsLeft, params.mBaseWidth, 0);
         mVisualInsetsRight = (int) Keyboard.Builder.getDimensionOrFraction(keyAttr,
                 R.styleable.Keyboard_Key_visualInsetsRight, params.mBaseWidth, 0);
-        mPreviewIcon = iconsSet.getIconByIconId(style.getInt(keyAttr,
+        final int previewIconAttrId = KeyboardIconsSet.getIconAttrId(style.getInt(keyAttr,
                 R.styleable.Keyboard_Key_keyIconPreview, KeyboardIconsSet.ICON_UNDEFINED));
-        mIcon = iconsSet.getIconByIconId(style.getInt(keyAttr,
+        mPreviewIcon = iconsSet.getIconByAttrId(previewIconAttrId);
+        final int iconAttrId = KeyboardIconsSet.getIconAttrId(style.getInt(keyAttr,
                 R.styleable.Keyboard_Key_keyIcon, KeyboardIconsSet.ICON_UNDEFINED));
-        mDisabledIcon = iconsSet.getIconByIconId(style.getInt(keyAttr,
+        mIcon = iconsSet.getIconByAttrId(iconAttrId);
+        final int disabledIconAttrId = KeyboardIconsSet.getIconAttrId(style.getInt(keyAttr,
                 R.styleable.Keyboard_Key_keyIconDisabled, KeyboardIconsSet.ICON_UNDEFINED));
+        mDisabledIcon = iconsSet.getIconByAttrId(disabledIconAttrId);
         mHintLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyHintLabel);
 
         mLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyLabel);
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java
index 6313a61b5f7185f9a43c2a1e726f515030cca52c..09ecbcaa028c2e03c06209273e2c0ec38a6d468e 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java
@@ -31,34 +31,36 @@ public class KeyboardIconsSet {
     private static final String TAG = KeyboardIconsSet.class.getSimpleName();
 
     public static final int ICON_UNDEFINED = 0;
+    private static final int ATTR_UNDEFINED = 0;
 
     private final Map<Integer, Drawable> mIcons = new HashMap<Integer, Drawable>();
 
     // The key value should be aligned with the enum value of Keyboard.icon*.
     private static final Map<Integer, Integer> ICONS_TO_ATTRS_MAP = new HashMap<Integer, Integer>();
+    private static final Map<String, Integer> NAME_TO_ATTRS_MAP = new HashMap<String, Integer>();
     private static final Collection<Integer> VALID_ATTRS;
 
     static {
-        addIconIdMap(1, R.styleable.Keyboard_iconShiftKey);
-        addIconIdMap(2, R.styleable.Keyboard_iconDeleteKey);
-        // This is also represented as "@icon/3" in keyboard layout XML.
-        addIconIdMap(3, R.styleable.Keyboard_iconSettingsKey);
-        addIconIdMap(4, R.styleable.Keyboard_iconSpaceKey);
-        addIconIdMap(5, R.styleable.Keyboard_iconReturnKey);
-        addIconIdMap(6, R.styleable.Keyboard_iconSearchKey);
-        // This is also represented as "@icon/7" in keyboard layout XML.
-        addIconIdMap(7, R.styleable.Keyboard_iconTabKey);
-        addIconIdMap(8, R.styleable.Keyboard_iconShortcutKey);
-        addIconIdMap(9, R.styleable.Keyboard_iconShortcutForLabel);
-        addIconIdMap(10, R.styleable.Keyboard_iconSpaceKeyForNumberLayout);
-        addIconIdMap(11, R.styleable.Keyboard_iconShiftKeyShifted);
-        addIconIdMap(12, R.styleable.Keyboard_iconDisabledShortcutKey);
-        addIconIdMap(13, R.styleable.Keyboard_iconPreviewTabKey);
+        addIconIdMap(1, "shiftKey", R.styleable.Keyboard_iconShiftKey);
+        addIconIdMap(2, "deleteKey", R.styleable.Keyboard_iconDeleteKey);
+        addIconIdMap(3, "settingsKey", R.styleable.Keyboard_iconSettingsKey);
+        addIconIdMap(4, "spaceKey", R.styleable.Keyboard_iconSpaceKey);
+        addIconIdMap(5, "returnKey", R.styleable.Keyboard_iconReturnKey);
+        addIconIdMap(6, "searchKey", R.styleable.Keyboard_iconSearchKey);
+        addIconIdMap(7, "tabKey", R.styleable.Keyboard_iconTabKey);
+        addIconIdMap(8, "shortcutKey", R.styleable.Keyboard_iconShortcutKey);
+        addIconIdMap(9, "shortcutForLabel", R.styleable.Keyboard_iconShortcutForLabel);
+        addIconIdMap(10, "spaceKeyForNumberLayout",
+                R.styleable.Keyboard_iconSpaceKeyForNumberLayout);
+        addIconIdMap(11, "shiftKeyShifted", R.styleable.Keyboard_iconShiftKeyShifted);
+        addIconIdMap(12, "disabledShortcurKey", R.styleable.Keyboard_iconDisabledShortcutKey);
+        addIconIdMap(13, "previewTabKey", R.styleable.Keyboard_iconPreviewTabKey);
         VALID_ATTRS = ICONS_TO_ATTRS_MAP.values();
     }
 
-    private static void addIconIdMap(int iconId, int attrId) {
+    private static void addIconIdMap(int iconId, String name, Integer attrId) {
         ICONS_TO_ATTRS_MAP.put(iconId, attrId);
+        NAME_TO_ATTRS_MAP.put(name, attrId);
     }
 
     public void loadIcons(final TypedArray keyboardAttrs) {
@@ -76,18 +78,29 @@ public class KeyboardIconsSet {
         }
     }
 
-    public Drawable getIconByIconId(final Integer iconId) {
+    public static int getIconAttrId(final Integer iconId) {
         if (iconId == ICON_UNDEFINED) {
-            return null;
+            return ATTR_UNDEFINED;
         }
         final Integer attrId = ICONS_TO_ATTRS_MAP.get(iconId);
         if (attrId == null) {
             throw new IllegalArgumentException("icon id is out of range: " + iconId);
         }
-        return getIconByAttrId(attrId);
+        return attrId;
+    }
+
+    public static int getIconAttrId(final String iconName) {
+        final Integer attrId = NAME_TO_ATTRS_MAP.get(iconName);
+        if (attrId == null) {
+            throw new IllegalArgumentException("unknown icon name: " + iconName);
+        }
+        return attrId;
     }
 
     public Drawable getIconByAttrId(final Integer attrId) {
+        if (attrId == ATTR_UNDEFINED) {
+            return null;
+        }
         if (!VALID_ATTRS.contains(attrId)) {
             throw new IllegalArgumentException("unknown icon attribute id: " + attrId);
         }
diff --git a/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParser.java b/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParser.java
index 2facf8439b952b7a2b7812fa132d9a9b3d2f6ddb..16777733e1ec487759b11b593615f9134b1b120a 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParser.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParser.java
@@ -18,7 +18,6 @@ package com.android.inputmethod.keyboard.internal;
 
 import android.content.res.Resources;
 import android.text.TextUtils;
-import android.util.Log;
 
 import com.android.inputmethod.keyboard.Keyboard;
 import com.android.inputmethod.latin.R;
@@ -32,15 +31,13 @@ import java.util.ArrayList;
  * Each "more key" specification is one of the following:
  * - A single letter (Letter)
  * - Label optionally followed by keyOutputText or code (keyLabel|keyOutputText).
- * - Icon followed by keyOutputText or code (@icon/icon_number|@integer/key_code)
+ * - Icon followed by keyOutputText or code (@icon/icon_name|@integer/key_code)
  * Special character, comma ',' backslash '\', and bar '|' can be escaped by '\'
  * character.
  * Note that the character '@' and '\' are also parsed by XML parser and CSV parser as well.
  * See {@link KeyboardIconsSet} about icon_number.
  */
 public class MoreKeySpecParser {
-    private static final String TAG = MoreKeySpecParser.class.getSimpleName();
-
     private static final char LABEL_END = '|';
     private static final String PREFIX_ICON = Utils.PREFIX_AT + "icon" + Utils.SUFFIX_SLASH;
     private static final String PREFIX_CODE = Utils.PREFIX_AT + "integer" + Utils.SUFFIX_SLASH;
@@ -167,16 +164,11 @@ public class MoreKeySpecParser {
         return Keyboard.CODE_OUTPUT_TEXT;
     }
 
-    public static int getIconId(String moreKeySpec) {
+    public static int getIconAttrId(String moreKeySpec) {
         if (hasIcon(moreKeySpec)) {
-            final int end = moreKeySpec.indexOf(LABEL_END, PREFIX_ICON.length() + 1);
-            final String iconId = moreKeySpec.substring(PREFIX_ICON.length(), end);
-            try {
-                return Integer.valueOf(iconId);
-            } catch (NumberFormatException e) {
-                Log.w(TAG, "illegal icon id specified: " + iconId);
-                return KeyboardIconsSet.ICON_UNDEFINED;
-            }
+            final int end = moreKeySpec.indexOf(LABEL_END, PREFIX_ICON.length());
+            final String name = moreKeySpec.substring(PREFIX_ICON.length(), end);
+            return KeyboardIconsSet.getIconAttrId(name);
         }
         return KeyboardIconsSet.ICON_UNDEFINED;
     }
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParserTests.java b/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParserTests.java
index ea11ff73df5cbc4ca7bafef045ddf024767f5714..74aaf9af8b96adab5ed30790c05350617472d9f7 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParserTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParserTests.java
@@ -25,11 +25,11 @@ import com.android.inputmethod.latin.R;
 public class MoreKeySpecParserTests extends AndroidTestCase {
     private Resources mRes;
 
-    private static final int ICON_SETTINGS_KEY = 5;
+    private static final int ICON_SETTINGS_KEY = R.styleable.Keyboard_iconSettingsKey;
     private static final int ICON_UNDEFINED = KeyboardIconsSet.ICON_UNDEFINED;
 
     private static final String CODE_SETTINGS = "@integer/key_settings";
-    private static final String ICON_SETTINGS = "@icon/" + ICON_SETTINGS_KEY;
+    private static final String ICON_SETTINGS = "@icon/settingsKey";
     private static final String CODE_NON_EXISTING = "@integer/non_existing";
     private static final String ICON_NON_EXISTING = "@icon/non_existing";
 
@@ -53,7 +53,7 @@ public class MoreKeySpecParserTests extends AndroidTestCase {
         String actualOutputText = MoreKeySpecParser.getOutputText(moreKeySpec);
         assertEquals(message + ": ouptputText:", expectedOutputText, actualOutputText);
 
-        int actualIcon = MoreKeySpecParser.getIconId(moreKeySpec);
+        int actualIcon = MoreKeySpecParser.getIconAttrId(moreKeySpec);
         assertEquals(message + ": icon:", expectedIcon, actualIcon);
 
         int actualCode = MoreKeySpecParser.getCode(mRes, moreKeySpec);
@@ -201,7 +201,7 @@ public class MoreKeySpecParserTests extends AndroidTestCase {
                 null, null, ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED);
         assertParserError("Icon without code", ICON_SETTINGS,
                 null, null, ICON_SETTINGS_KEY, Keyboard.CODE_UNSPECIFIED);
-        assertParser("Non existing icon", ICON_NON_EXISTING + "|abc",
+        assertParserError("Non existing icon", ICON_NON_EXISTING + "|abc",
                 null, "abc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
         assertParserError("Non existing code", "abc|" + CODE_NON_EXISTING,
                 "abc", null, ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED);