summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 09:21:02 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 09:21:02 +0000
commit6f63fd49ff65e5793e7acee2e3969e794d714ce1 (patch)
treea2350a57b1dc76c217a09a59a2213ec69845c25a
parent47dae0e3d466cae9bb8a0e90cbeaf6449b3a72e5 (diff)
downloadchromium_src-6f63fd49ff65e5793e7acee2e3969e794d714ce1.zip
chromium_src-6f63fd49ff65e5793e7acee2e3969e794d714ce1.tar.gz
chromium_src-6f63fd49ff65e5793e7acee2e3969e794d714ce1.tar.bz2
Add strings for Mozc for US Dvorak and Google Japanese Input for US Dvorak.
TEST=wrote unit tests BUG=chromium-os:4157 Review URL: http://codereview.chromium.org/2865009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50340 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd8
-rw-r--r--chrome/browser/chromeos/input_method/input_method_util.cc4
-rw-r--r--chrome/browser/chromeos/input_method/input_method_util_unittest.cc27
3 files changed, 30 insertions, 9 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 41bc30d..1bc073e 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -8216,6 +8216,10 @@ Keep your key file in a safe place. You will need it to create new versions of y
desc="The label for the Japanese input method for US keyboard">
Japanese input method (for US keyboard)
</message>
+ <message name="IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_MOZC_US_DV_INPUT_METHOD"
+ desc="The label for the Japanese input method for US Dvorak keyboard">
+ Japanese input method (for US Dvorak keyboard)
+ </message>
<message name="IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_MOZC_JP_INPUT_METHOD"
desc="The label for the Japanese input method for Japanese keyboard">
Japanese input method (for Japanese keyboard)
@@ -8224,6 +8228,10 @@ Keep your key file in a safe place. You will need it to create new versions of y
desc="The label for the Google Japanese Input input method for US keyboard">
Google Japanese Input (for US keyboard)
</message>
+ <message name="IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_GOOGLE_US_DV_INPUT_METHOD"
+ desc="The label for the Google Japanese Input input method for US Dvorak keyboard">
+ Google Japanese Input (for US Dvorak keyboard)
+ </message>
<message name="IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_GOOGLE_JP_INPUT_METHOD"
desc="The label for the Google Japanese Input input method for Japanese keyboard">
Google Japanese Input (for Japanese keyboard)
diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc
index 14dc3f9..cd2661d 100644
--- a/chrome/browser/chromeos/input_method/input_method_util.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc
@@ -155,10 +155,14 @@ const struct EnglishToResouceId {
{ "Pinyin", IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_INPUT_METHOD },
{ "Mozc (US keyboard layout)",
IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_MOZC_US_INPUT_METHOD },
+ { "Mozc (US Dvorak keyboard layout)",
+ IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_MOZC_US_DV_INPUT_METHOD },
{ "Mozc (Japanese keyboard layout)",
IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_MOZC_JP_INPUT_METHOD },
{ "Google Japanese Input (US keyboard layout)",
IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_GOOGLE_US_INPUT_METHOD },
+ { "Google Japanese Input (US Dvorak keyboard layout)",
+ IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_GOOGLE_US_DV_INPUT_METHOD },
{ "Google Japanese Input (Japanese keyboard layout)",
IDS_OPTIONS_SETTINGS_LANGUAGES_JAPANESE_GOOGLE_JP_INPUT_METHOD },
{ "Korean", IDS_OPTIONS_SETTINGS_LANGUAGES_KOREAN_INPUT_METHOD },
diff --git a/chrome/browser/chromeos/input_method/input_method_util_unittest.cc b/chrome/browser/chromeos/input_method/input_method_util_unittest.cc
index 0c1543d..16d3a512 100644
--- a/chrome/browser/chromeos/input_method/input_method_util_unittest.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util_unittest.cc
@@ -14,7 +14,16 @@
namespace chromeos {
namespace input_method {
-TEST(InputMethodUtilTest, FindLocalizedStringTest) {
+TEST(InputMethodUtilTest, GetStringUTF8) {
+ EXPECT_EQ("Pinyin input method",
+ GetStringUTF8("Pinyin"));
+ EXPECT_EQ("Japanese input method (for US Dvorak keyboard)",
+ GetStringUTF8("Mozc (US Dvorak keyboard layout)"));
+ EXPECT_EQ("Google Japanese Input (for US Dvorak keyboard)",
+ GetStringUTF8("Google Japanese Input (US Dvorak keyboard layout)"));
+}
+
+TEST(InputMethodUtilTest, StringIsSupported) {
EXPECT_TRUE(StringIsSupported("Hiragana"));
EXPECT_TRUE(StringIsSupported("Latin"));
EXPECT_TRUE(StringIsSupported("Direct input"));
@@ -65,20 +74,20 @@ TEST(InputMethodUtilTest, GetLanguageCodeFromDescriptor) {
InputMethodDescriptor("xkb:uk::eng", "United Kingdom", "us", "eng")));
}
-TEST(LanguageConfigModelTest, MaybeRewriteLanguageName) {
+TEST(InputMethodUtilTest, MaybeRewriteLanguageName) {
EXPECT_EQ(L"English", MaybeRewriteLanguageName(L"English"));
EXPECT_EQ(l10n_util::GetString(IDS_OPTIONS_SETTINGS_LANGUAGES_OTHERS),
MaybeRewriteLanguageName(L"t"));
}
-TEST(LanguageConfigModelTest, GetLanguageDisplayNameFromCode) {
+TEST(InputMethodUtilTest, GetLanguageDisplayNameFromCode) {
EXPECT_EQ(L"French", GetLanguageDisplayNameFromCode("fr"));
// MaybeRewriteLanguageName() should be applied.
EXPECT_EQ(l10n_util::GetString(IDS_OPTIONS_SETTINGS_LANGUAGES_OTHERS),
GetLanguageDisplayNameFromCode("t"));
}
-TEST(LanguageConfigModelTest, SortLanguageCodesByNames) {
+TEST(InputMethodUtilTest, SortLanguageCodesByNames) {
std::vector<std::string> language_codes;
// Check if this function can handle an empty list.
SortLanguageCodesByNames(&language_codes);
@@ -147,7 +156,7 @@ TEST(LanguageConfigModelTest, SortInputMethodIdsByNamesInternal) {
ASSERT_EQ("m17n:latn-pre", input_method_ids[4]); // Others
}
-TEST(LanguageConfigModelTest, ReorderInputMethodIdsForLanguageCode_DE) {
+TEST(InputMethodUtilTest, ReorderInputMethodIdsForLanguageCode_DE) {
std::vector<std::string> input_method_ids;
input_method_ids.push_back("xkb:ch::ger"); // Switzerland - German
input_method_ids.push_back("xkb:de::ger"); // Germany - German
@@ -158,7 +167,7 @@ TEST(LanguageConfigModelTest, ReorderInputMethodIdsForLanguageCode_DE) {
EXPECT_EQ("xkb:ch::ger", input_method_ids[1]);
}
-TEST(LanguageConfigModelTest, ReorderInputMethodIdsForLanguageCode_FR) {
+TEST(InputMethodUtilTest, ReorderInputMethodIdsForLanguageCode_FR) {
std::vector<std::string> input_method_ids;
input_method_ids.push_back("xkb:be::fra"); // Belgium - French
input_method_ids.push_back("xkb:fr::fra"); // France - French
@@ -169,7 +178,7 @@ TEST(LanguageConfigModelTest, ReorderInputMethodIdsForLanguageCode_FR) {
EXPECT_EQ("xkb:be::fra", input_method_ids[1]);
}
-TEST(LanguageConfigModelTest, ReorderInputMethodIdsForLanguageCode_EN_US) {
+TEST(InputMethodUtilTest, ReorderInputMethodIdsForLanguageCode_EN_US) {
std::vector<std::string> input_method_ids;
input_method_ids.push_back("xkb:us:dvorak:eng"); // US - Dvorak - English
input_method_ids.push_back("xkb:us::eng"); // US - English
@@ -180,7 +189,7 @@ TEST(LanguageConfigModelTest, ReorderInputMethodIdsForLanguageCode_EN_US) {
EXPECT_EQ("xkb:us:dvorak:eng", input_method_ids[1]);
}
-TEST(LanguageConfigModelTest, ReorderInputMethodIdsForLanguageCode_FI) {
+TEST(InputMethodUtilTest, ReorderInputMethodIdsForLanguageCode_FI) {
std::vector<std::string> input_method_ids;
input_method_ids.push_back("xkb:fi::fin"); // Finland - Finnish
ReorderInputMethodIdsForLanguageCode("fi", &input_method_ids);
@@ -189,7 +198,7 @@ TEST(LanguageConfigModelTest, ReorderInputMethodIdsForLanguageCode_FI) {
EXPECT_EQ("xkb:fi::fin", input_method_ids[0]);
}
-TEST(LanguageConfigModelTest, ReorderInputMethodIdsForLanguageCode_Noop) {
+TEST(InputMethodUtilTest, ReorderInputMethodIdsForLanguageCode_Noop) {
std::vector<std::string> input_method_ids;
input_method_ids.push_back("xkb:fr::fra"); // France - French
input_method_ids.push_back("xkb:be::fra"); // Belgium - French