Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4413)

Unified Diff: chrome/browser/chromeos/input_method/input_method_util.cc

Issue 10960060: fix "IME changed" notification uses a wrong field of IME (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix name: mappint to mapping Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/input_method/input_method_util.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc
index 798a511f4d816905f1c4e53084058d3537492acc..0c91438241616e65131764b393c6d3c86aecac35 100644
--- a/chrome/browser/chromeos/input_method/input_method_util.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc
@@ -61,6 +61,22 @@ const struct {
const size_t kMappingFromIdToIndicatorTextLen =
ARRAYSIZE_UNSAFE(kMappingFromIdToIndicatorText);
+// A mapping from an input method id to a medium length language indicator.
+// For those languages that want to display a slightly longer text in the
+// "Your input method has changed to..." bubble than in the status tray.
+// If an entry is not found in this table the short name is used.
+const struct {
+ const char* input_method_id;
+ const char* medium_length_name;
+} kMappingFromIdToMediumLengthName[] = {
+ { "mozc", "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" },
Yusuke Sato 2012/09/24 22:00:50 Two requests: 1. Please use chrome/app/generated_
sschmitz 2012/09/24 22:48:14 I can do that. Who will translate? And, for each o
Yusuke Sato 2012/09/24 23:15:24 L10N folks will take care of that for you: http://
sschmitz 2012/09/25 01:41:43 Done.
+ { "mozc-dv", "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" },
+ { "mozc-jp", "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" },
+ { "zinnia-japanese", "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" },
Jun Mukai 2012/09/24 21:48:32 It would be fine for Japanese, but what about othe
Daniel Erat 2012/09/24 21:50:27 Is this a suggestion to make all of these instead
Yusuke Sato 2012/09/24 22:00:50 ditto. please remove zinnia.
Yusuke Sato 2012/09/24 22:03:44 +1 for translatable string for kMappingFromIdToMed
sschmitz 2012/09/25 01:41:43 I followed Yusuke's advice and left the way for sh
+};
+const size_t kMappingFromIdToMediumLengthNameLen =
+ ARRAYSIZE_UNSAFE(kMappingFromIdToMediumLengthName);
+
string16 GetLanguageName(const std::string& language_code) {
const string16 language_name = l10n_util::GetDisplayNameForLocale(
language_code, g_browser_process->GetApplicationLocale(), true);
@@ -385,6 +401,20 @@ std::string InputMethodUtil::GetInputMethodDisplayNameFromId(
return "";
}
+string16 InputMethodUtil::GetInputMethodMediumName(
Daniel Erat 2012/09/24 21:31:29 nit: make the order here match that in the header
sschmitz 2012/09/25 01:41:43 Done.
+ const InputMethodDescriptor& input_method) const {
+ // For the "Your input method has changed to..." bubble. In most cases
+ // it uses the same name as the short name, unless found in a table
+ // for medium length names.
+ for (size_t i = 0; i < kMappingFromIdToMediumLengthNameLen; ++i) {
+ if (kMappingFromIdToMediumLengthName[i].input_method_id ==
+ input_method.id())
+ return
+ UTF8ToUTF16(kMappingFromIdToMediumLengthName[i].medium_length_name);
+ }
+ return GetInputMethodShortName(input_method);
+}
+
string16 InputMethodUtil::GetInputMethodShortName(
const InputMethodDescriptor& input_method) const {
// For the status area, we use two-letter, upper-case language code like

Powered by Google App Engine
This is Rietveld 408576698