diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chromeos/status/language_menu_button.cc | 10 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/language_menu_button_unittest.cc | 20 |
2 files changed, 28 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/status/language_menu_button.cc b/chrome/browser/chromeos/status/language_menu_button.cc index a8bc7d0..169640d 100644 --- a/chrome/browser/chromeos/status/language_menu_button.cc +++ b/chrome/browser/chromeos/status/language_menu_button.cc @@ -86,6 +86,12 @@ const struct { { "mozc", "\xe3\x81\x82" }, // Japanese Hiragana letter A in UTF-8. { "mozc-dv", "\xe3\x81\x82" }, { "mozc-jp", "\xe3\x81\x82" }, + // For simplified Chinese input methods + { "pinyin", "\xe6\x8b\xbc" }, // U+62FC + // For traditional Chinese input methods + { "chewing", "\xe9\x85\xb7" }, // U+9177 + { "m17n:zh:cangjie", "\xe5\x80\x89" }, // U+5009 + // TODO(yusukes): Add m17n:zh:quick if there's a good Hanzi character for it. // Handle "m17n:t" input methods here since ICU is not able to handle the // language code "t". Note: most users use either latn-pre or latn-post @@ -600,8 +606,8 @@ std::wstring LanguageMenuButton::GetTextForIndicator( } // TODO(yusukes): Some languages have two or more input methods. For example, - // Thai has 3, Traditional Chinese has many. If these input methods could be - // activated at the same time, we should do either of the following: + // Thai has 3, Vietnamese has 4. If these input methods could be activated at + // the same time, we should do either of the following: // (1) Add mappings to |kMappingFromIdToIndicatorText| // (2) Add suffix (1, 2, ...) to |text| when ambiguous. diff --git a/chrome/browser/chromeos/status/language_menu_button_unittest.cc b/chrome/browser/chromeos/status/language_menu_button_unittest.cc index a5094ca..11aabc9 100644 --- a/chrome/browser/chromeos/status/language_menu_button_unittest.cc +++ b/chrome/browser/chromeos/status/language_menu_button_unittest.cc @@ -45,6 +45,26 @@ TEST(LanguageMenuButtonTest, GetTextForIndicatorTest) { } { InputMethodDescriptor desc("pinyin", "Pinyin", "us", "zh-CN"); + EXPECT_EQ(UTF8ToWide("\xe6\x8b\xbc"), + LanguageMenuButton::GetTextForIndicator(desc)); + } + { + InputMethodDescriptor desc("chewing", "Chewing", "us", "zh-TW"); + EXPECT_EQ(UTF8ToWide("\xe9\x85\xb7"), + LanguageMenuButton::GetTextForIndicator(desc)); + } + { + InputMethodDescriptor desc("m17n:zh:cangjie", "Cangjie", "us", "zh-TW"); + EXPECT_EQ(UTF8ToWide("\xe5\x80\x89"), + LanguageMenuButton::GetTextForIndicator(desc)); + } + { + InputMethodDescriptor desc("m17n:zh:quick", "Quick", "us", "zh-TW"); + EXPECT_EQ(UTF8ToWide("TW"), + LanguageMenuButton::GetTextForIndicator(desc)); + } + { + InputMethodDescriptor desc("pinyin", "Pinyin", "us", "zh-CN"); EXPECT_EQ(UTF8ToWide("CN"), LanguageMenuButton::GetTextForIndicator(desc)); } |