Commit 03ae97c2 authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

[OsSettingsLanguages] Update Belgium and US International inputs name

Proposed new name found in http://go/cros-input-methods
Rationale: http://go/cros-input-methods-naming

Current view for US International: http://screen/3sankWPvq6xQW2R
New view for US International: http://screen/BrfNpMZn7GYzS5h

Current view for Belgium: http://screen/B9USEaX8iX2JuTp
New view for Belgium: http://screen/4A4hVAMrK62JP2z

Remove adding language before input name logic as there are no longer
duplicate names for IME tray.

It's fine not to update string for OOBE for now because it's clear
what language the keyboard is referring to.
OOBE view: http://go/cros-oobe-2019#slide=24

Bug: 1113439, 889763
Change-Id: Ia7dadd44874937872c1f10fa51ca81e344378ed6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2423068Reviewed-by: default avatarShu Chen <shuchen@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: My Nguyen <myy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809639}
parent 70baebd0
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
"options_page": "hmm_options.html?code=xkb:us:intl:nld" "options_page": "hmm_options.html?code=xkb:us:intl:nld"
}, },
{ {
"name": "__MSG_keyboard_us_international_pc__", "name": "__MSG_keyboard_netherlands_us_international_pc__",
"type": "ime", "type": "ime",
"id": "xkb:us:intl_pc:nld", "id": "xkb:us:intl_pc:nld",
"indicator": "NLD", "indicator": "NLD",
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
"options_page": "hmm_options.html?code=xkb:us:workman-intl:eng" "options_page": "hmm_options.html?code=xkb:us:workman-intl:eng"
}, },
{ {
"name": "__MSG_keyboard_belgian__", "name": "__MSG_keyboard_belgian_dutch__",
"type": "ime", "type": "ime",
"id": "xkb:be::nld", "id": "xkb:be::nld",
"description": "", "description": "",
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
"options_page": "hmm_options.html?code=xkb:fr:bepo:fra" "options_page": "hmm_options.html?code=xkb:fr:bepo:fra"
}, },
{ {
"name": "__MSG_keyboard_belgian__", "name": "__MSG_keyboard_belgian_french__",
"type": "ime", "type": "ime",
"id": "xkb:be::fra", "id": "xkb:be::fra",
"description": "", "description": "",
...@@ -390,7 +390,7 @@ ...@@ -390,7 +390,7 @@
"options_page": "hmm_options.html?code=xkb:de:neo:ger" "options_page": "hmm_options.html?code=xkb:de:neo:ger"
}, },
{ {
"name": "__MSG_keyboard_belgian__", "name": "__MSG_keyboard_belgian_german__",
"type": "ime", "type": "ime",
"id": "xkb:be::ger", "id": "xkb:be::ger",
"description": "", "description": "",
...@@ -471,7 +471,7 @@ ...@@ -471,7 +471,7 @@
"options_page": "hmm_options.html?code=xkb:br::por" "options_page": "hmm_options.html?code=xkb:br::por"
}, },
{ {
"name": "__MSG_keyboard_us_international__", "name": "__MSG_keyboard_portuguese_us_international__",
"type": "ime", "type": "ime",
"id": "xkb:us:intl:por", "id": "xkb:us:intl:por",
"indicator": "INTL", "indicator": "INTL",
...@@ -485,7 +485,7 @@ ...@@ -485,7 +485,7 @@
"options_page": "hmm_options.html?code=xkb:us:intl:por" "options_page": "hmm_options.html?code=xkb:us:intl:por"
}, },
{ {
"name": "__MSG_keyboard_us_international_pc__", "name": "__MSG_keyboard_portuguese_us_international_pc__",
"type": "ime", "type": "ime",
"id": "xkb:us:intl_pc:por", "id": "xkb:us:intl_pc:por",
"indicator": "INTL", "indicator": "INTL",
......
...@@ -230,7 +230,9 @@ const struct InputMethodNameMap { ...@@ -230,7 +230,9 @@ const struct InputMethodNameMap {
{"__MSG_KEYBOARD_ARMENIAN_PHONETIC__", {"__MSG_KEYBOARD_ARMENIAN_PHONETIC__",
IDS_IME_NAME_KEYBOARD_ARMENIAN_PHONETIC}, IDS_IME_NAME_KEYBOARD_ARMENIAN_PHONETIC},
{"__MSG_KEYBOARD_BELARUSIAN__", IDS_IME_NAME_KEYBOARD_BELARUSIAN}, {"__MSG_KEYBOARD_BELARUSIAN__", IDS_IME_NAME_KEYBOARD_BELARUSIAN},
{"__MSG_KEYBOARD_BELGIAN__", IDS_IME_NAME_KEYBOARD_BELGIAN}, {"__MSG_KEYBOARD_BELGIAN_DUTCH__", IDS_IME_NAME_KEYBOARD_BELGIAN_DUTCH},
{"__MSG_KEYBOARD_BELGIAN_FRENCH__", IDS_IME_NAME_KEYBOARD_BELGIAN_FRENCH},
{"__MSG_KEYBOARD_BELGIAN_GERMAN__", IDS_IME_NAME_KEYBOARD_BELGIAN_GERMAN},
{"__MSG_KEYBOARD_BENGALI_PHONETIC__", {"__MSG_KEYBOARD_BENGALI_PHONETIC__",
IDS_IME_NAME_KEYBOARD_BENGALI_PHONETIC}, IDS_IME_NAME_KEYBOARD_BENGALI_PHONETIC},
{"__MSG_KEYBOARD_BRAZILIAN__", IDS_IME_NAME_KEYBOARD_BRAZILIAN}, {"__MSG_KEYBOARD_BRAZILIAN__", IDS_IME_NAME_KEYBOARD_BRAZILIAN},
...@@ -280,19 +282,25 @@ const struct InputMethodNameMap { ...@@ -280,19 +282,25 @@ const struct InputMethodNameMap {
{"__MSG_KEYBOARD_LATVIAN__", IDS_IME_NAME_KEYBOARD_LATVIAN}, {"__MSG_KEYBOARD_LATVIAN__", IDS_IME_NAME_KEYBOARD_LATVIAN},
{"__MSG_KEYBOARD_LITHUANIAN__", IDS_IME_NAME_KEYBOARD_LITHUANIAN}, {"__MSG_KEYBOARD_LITHUANIAN__", IDS_IME_NAME_KEYBOARD_LITHUANIAN},
{"__MSG_KEYBOARD_MACEDONIAN__", IDS_IME_NAME_KEYBOARD_MACEDONIAN}, {"__MSG_KEYBOARD_MACEDONIAN__", IDS_IME_NAME_KEYBOARD_MACEDONIAN},
{"__MSG_KEYBOARD_MALAY__", IDS_IME_NAME_KEYBOARD_MALAY},
{"__MSG_KEYBOARD_MALAYALAM_PHONETIC__", {"__MSG_KEYBOARD_MALAYALAM_PHONETIC__",
IDS_IME_NAME_KEYBOARD_MALAYALAM_PHONETIC}, IDS_IME_NAME_KEYBOARD_MALAYALAM_PHONETIC},
{"__MSG_KEYBOARD_MALAY__", IDS_IME_NAME_KEYBOARD_MALAY},
{"__MSG_KEYBOARD_MALTESE__", IDS_IME_NAME_KEYBOARD_MALTESE}, {"__MSG_KEYBOARD_MALTESE__", IDS_IME_NAME_KEYBOARD_MALTESE},
{"__MSG_KEYBOARD_MONGOLIAN__", IDS_IME_NAME_KEYBOARD_MONGOLIAN}, {"__MSG_KEYBOARD_MONGOLIAN__", IDS_IME_NAME_KEYBOARD_MONGOLIAN},
{"__MSG_KEYBOARD_MYANMAR_MYANSAN__", IDS_IME_NAME_KEYBOARD_MYANMAR_MYANSAN}, {"__MSG_KEYBOARD_MYANMAR_MYANSAN__", IDS_IME_NAME_KEYBOARD_MYANMAR_MYANSAN},
{"__MSG_KEYBOARD_MYANMAR__", IDS_IME_NAME_KEYBOARD_MYANMAR}, {"__MSG_KEYBOARD_MYANMAR__", IDS_IME_NAME_KEYBOARD_MYANMAR},
{"__MSG_KEYBOARD_NEPALI_INSCRIPT__", IDS_IME_NAME_KEYBOARD_NEPALI_INSCRIPT}, {"__MSG_KEYBOARD_NEPALI_INSCRIPT__", IDS_IME_NAME_KEYBOARD_NEPALI_INSCRIPT},
{"__MSG_KEYBOARD_NEPALI_PHONETIC__", IDS_IME_NAME_KEYBOARD_NEPALI_PHONETIC}, {"__MSG_KEYBOARD_NEPALI_PHONETIC__", IDS_IME_NAME_KEYBOARD_NEPALI_PHONETIC},
{"__MSG_KEYBOARD_NETHERLANDS_US_INTERNATIONAL_PC__",
IDS_IME_NAME_KEYBOARD_NETHERLANDS_US_INTERNATIONAL_PC},
{"__MSG_KEYBOARD_NETHERLANDS__", IDS_IME_NAME_KEYBOARD_NETHERLANDS}, {"__MSG_KEYBOARD_NETHERLANDS__", IDS_IME_NAME_KEYBOARD_NETHERLANDS},
{"__MSG_KEYBOARD_NORWEGIAN__", IDS_IME_NAME_KEYBOARD_NORWEGIAN}, {"__MSG_KEYBOARD_NORWEGIAN__", IDS_IME_NAME_KEYBOARD_NORWEGIAN},
{"__MSG_KEYBOARD_PERSIAN__", IDS_IME_NAME_KEYBOARD_PERSIAN}, {"__MSG_KEYBOARD_PERSIAN__", IDS_IME_NAME_KEYBOARD_PERSIAN},
{"__MSG_KEYBOARD_POLISH__", IDS_IME_NAME_KEYBOARD_POLISH}, {"__MSG_KEYBOARD_POLISH__", IDS_IME_NAME_KEYBOARD_POLISH},
{"__MSG_KEYBOARD_PORTUGUESE_US_INTERNATIONAL_PC__",
IDS_IME_NAME_KEYBOARD_PORTUGUESE_US_INTERNATIONAL_PC},
{"__MSG_KEYBOARD_PORTUGUESE_US_INTERNATIONAL__",
IDS_IME_NAME_KEYBOARD_PORTUGUESE_US_INTERNATIONAL},
{"__MSG_KEYBOARD_PORTUGUESE__", IDS_IME_NAME_KEYBOARD_PORTUGUESE}, {"__MSG_KEYBOARD_PORTUGUESE__", IDS_IME_NAME_KEYBOARD_PORTUGUESE},
{"__MSG_KEYBOARD_ROMANIAN_STANDARD__", {"__MSG_KEYBOARD_ROMANIAN_STANDARD__",
IDS_IME_NAME_KEYBOARD_ROMANIAN_STANDARD}, IDS_IME_NAME_KEYBOARD_ROMANIAN_STANDARD},
...@@ -517,23 +525,9 @@ base::string16 InputMethodUtil::GetInputMethodLongNameInternal( ...@@ -517,23 +525,9 @@ base::string16 InputMethodUtil::GetInputMethodLongNameInternal(
return base::UTF8ToUTF16(localized_display_name); return base::UTF8ToUTF16(localized_display_name);
} }
// We don't show language here. Name of keyboard layout or input method
// usually imply (or explicitly include) its language.
// Special case for German, French and Dutch: these languages have multiple
// keyboard layouts and share the same layout of keyboard (Belgian). We need
// to show explicitly the language for the layout.
DCHECK(!input_method.language_codes().empty());
const std::string language_code = input_method.language_codes().at(0);
base::string16 text = (short_name || localized_display_name.empty()) base::string16 text = (short_name || localized_display_name.empty())
? TranslateString(input_method.id()) ? TranslateString(input_method.id())
: base::UTF8ToUTF16(localized_display_name); : base::UTF8ToUTF16(localized_display_name);
if (language_code == "de" || language_code == "fr" || language_code == "nl") {
const base::string16 language_name = delegate_->GetDisplayLanguageName(
language_code);
text = language_name + base::UTF8ToUTF16(" - ") + text;
}
DCHECK(!text.empty()); DCHECK(!text.empty());
return text; return text;
} }
......
...@@ -205,8 +205,7 @@ TEST_F(InputMethodUtilTest, GetInputMethodMediumNameTest) { ...@@ -205,8 +205,7 @@ TEST_F(InputMethodUtilTest, GetInputMethodMediumNameTest) {
} }
TEST_F(InputMethodUtilTest, GetInputMethodLongNameTest) { TEST_F(InputMethodUtilTest, GetInputMethodLongNameTest) {
// For most languages input method or keyboard layout name is returned. // Input method or keyboard layout name is returned.
// See below for exceptions.
{ {
InputMethodDescriptor desc = GetDesc("xkb:jp::jpn", "jp", "ja", ""); InputMethodDescriptor desc = GetDesc("xkb:jp::jpn", "jp", "ja", "");
EXPECT_EQ(ASCIIToUTF16("Japanese"), util_.GetInputMethodLongName(desc)); EXPECT_EQ(ASCIIToUTF16("Japanese"), util_.GetInputMethodLongName(desc));
...@@ -221,35 +220,6 @@ TEST_F(InputMethodUtilTest, GetInputMethodLongNameTest) { ...@@ -221,35 +220,6 @@ TEST_F(InputMethodUtilTest, GetInputMethodLongNameTest) {
GetDesc("xkb:gb:dvorak:eng", "gb(dvorak)", "en-US", ""); GetDesc("xkb:gb:dvorak:eng", "gb(dvorak)", "en-US", "");
EXPECT_EQ(ASCIIToUTF16("UK Dvorak"), util_.GetInputMethodLongName(desc)); EXPECT_EQ(ASCIIToUTF16("UK Dvorak"), util_.GetInputMethodLongName(desc));
} }
// For Dutch, French, German and Hindi,
// "language - keyboard layout" pair is returned.
{
InputMethodDescriptor desc = GetDesc("xkb:be::nld", "be", "nl", "");
EXPECT_EQ(ASCIIToUTF16("Dutch - Belgian"),
util_.GetInputMethodLongName(desc));
}
{
InputMethodDescriptor desc = GetDesc("xkb:fr::fra", "fr", "fr", "");
EXPECT_EQ(ASCIIToUTF16("French - French"),
util_.GetInputMethodLongName(desc));
}
{
InputMethodDescriptor desc = GetDesc("xkb:be::fra", "be", "fr", "");
EXPECT_EQ(ASCIIToUTF16("French - Belgian"),
util_.GetInputMethodLongName(desc));
}
{
InputMethodDescriptor desc = GetDesc("xkb:de::ger", "de", "de", "");
EXPECT_EQ(ASCIIToUTF16("German - German"),
util_.GetInputMethodLongName(desc));
}
{
InputMethodDescriptor desc = GetDesc("xkb:be::ger", "be", "de", "");
EXPECT_EQ(ASCIIToUTF16("German - Belgian"),
util_.GetInputMethodLongName(desc));
}
{ {
InputMethodDescriptor desc = GetDesc("invalid-id", "us", "xx", ""); InputMethodDescriptor desc = GetDesc("invalid-id", "us", "xx", "");
// You can safely ignore the "Resouce ID is not found for: invalid-id" // You can safely ignore the "Resouce ID is not found for: invalid-id"
......
...@@ -713,8 +713,14 @@ ...@@ -713,8 +713,14 @@
<message name="IDS_IME_NAME_KEYBOARD_BELARUSIAN" desc="The input method name shows in system tray menu, this shows [Belarusian keyboard]."> <message name="IDS_IME_NAME_KEYBOARD_BELARUSIAN" desc="The input method name shows in system tray menu, this shows [Belarusian keyboard].">
Belarusian keyboard Belarusian keyboard
</message> </message>
<message name="IDS_IME_NAME_KEYBOARD_BELGIAN" desc="The input method name shows in system tray menu, this shows [Belgian keyboard]."> <message name="IDS_IME_NAME_KEYBOARD_BELGIAN_DUTCH" desc="The input method name shows in system tray menu and settings page.">
Belgian keyboard Dutch (Belgium)
</message>
<message name="IDS_IME_NAME_KEYBOARD_BELGIAN_FRENCH" desc="The input method name shows in system tray menu and settings page.">
French (Belgium)
</message>
<message name="IDS_IME_NAME_KEYBOARD_BELGIAN_GERMAN" desc="The input method name shows in system tray menu and settings page.">
German (Belgium)
</message> </message>
<message name="IDS_IME_NAME_KEYBOARD_BRAZILIAN" desc="The input method name shows in system tray menu, this shows [Brazilian keyboard]."> <message name="IDS_IME_NAME_KEYBOARD_BRAZILIAN" desc="The input method name shows in system tray menu, this shows [Brazilian keyboard].">
Brazilian keyboard Brazilian keyboard
...@@ -827,6 +833,9 @@ ...@@ -827,6 +833,9 @@
<message name="IDS_IME_NAME_KEYBOARD_MONGOLIAN" desc="The input method name shows in system tray menu, this shows [Mongolian keyboard]."> <message name="IDS_IME_NAME_KEYBOARD_MONGOLIAN" desc="The input method name shows in system tray menu, this shows [Mongolian keyboard].">
Mongolian keyboard Mongolian keyboard
</message> </message>
<message name="IDS_IME_NAME_KEYBOARD_NETHERLANDS_US_INTERNATIONAL_PC" desc="The input method name shows in system tray menu and settings page.">
Dutch (Netherlands) with US International PC keyboard
</message>
<message name="IDS_IME_NAME_KEYBOARD_NETHERLANDS" desc="The input method name shows in system tray menu, this shows [Netherlands keyboard]."> <message name="IDS_IME_NAME_KEYBOARD_NETHERLANDS" desc="The input method name shows in system tray menu, this shows [Netherlands keyboard].">
Netherlands keyboard Netherlands keyboard
</message> </message>
...@@ -839,6 +848,12 @@ ...@@ -839,6 +848,12 @@
<message name="IDS_IME_NAME_KEYBOARD_PORTUGUESE" desc="The input method name shows in system tray menu, this shows [Portuguese keyboard]."> <message name="IDS_IME_NAME_KEYBOARD_PORTUGUESE" desc="The input method name shows in system tray menu, this shows [Portuguese keyboard].">
Portuguese keyboard Portuguese keyboard
</message> </message>
<message name="IDS_IME_NAME_KEYBOARD_PORTUGUESE_US_INTERNATIONAL" desc="The input method name shows in system tray menu and settings page.">
Portuguese with US International keyboard
</message>
<message name="IDS_IME_NAME_KEYBOARD_PORTUGUESE_US_INTERNATIONAL_PC" desc="The input method name shows in system tray menu and settings page.">
Portuguese with US International PC keyboard
</message>
<message name="IDS_IME_NAME_KEYBOARD_ROMANIAN" desc="The input method name shows in system tray menu, this shows [Romanian keyboard]."> <message name="IDS_IME_NAME_KEYBOARD_ROMANIAN" desc="The input method name shows in system tray menu, this shows [Romanian keyboard].">
Romanian keyboard Romanian keyboard
</message> </message>
......
ffc8137ab73851b32db79559d9245fad97f8017f
\ No newline at end of file
ffc8137ab73851b32db79559d9245fad97f8017f
\ No newline at end of file
ffc8137ab73851b32db79559d9245fad97f8017f
\ No newline at end of file
fd5c82f95ac16720f0be8706484fe32311d4bc0c
\ No newline at end of file
fd5c82f95ac16720f0be8706484fe32311d4bc0c
\ No newline at end of file
fd5c82f95ac16720f0be8706484fe32311d4bc0c
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment