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 4361b1154cfad28ac7af7beeb9278e4a1df2739d..5ce5269223e6dc31146d52d2e75575a5f6b4998f 100644 |
--- a/chrome/browser/chromeos/input_method/input_method_util.cc |
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc |
@@ -402,12 +402,17 @@ InputMethodUtil::~InputMethodUtil() { |
bool InputMethodUtil::TranslateStringInternal( |
const std::string& english_string, base::string16 *out_string) const { |
DCHECK(out_string); |
- HashType::const_iterator iter = english_to_resource_id_.find(english_string); |
+ // |english_string| could be an input method id. So legacy xkb id is required |
+ // to get the translated string. |
+ std::string key_string = extension_ime_util::MaybeGetLegacyXkbId( |
+ english_string); |
+ HashType::const_iterator iter = english_to_resource_id_.find(key_string); |
+ |
if (iter == english_to_resource_id_.end()) { |
// TODO(yusukes): Write Autotest which checks if all display names and all |
// property names for supported input methods are listed in the resource |
// ID array (crosbug.com/4572). |
- LOG(ERROR) << "Resource ID is not found for: " << english_string; |
+ LOG(ERROR) << "Resource ID is not found for: " << key_string; |
return false; |
} |
@@ -550,12 +555,7 @@ base::string16 InputMethodUtil::GetInputMethodLongName( |
DCHECK(!input_method.language_codes().empty()); |
const std::string language_code = input_method.language_codes().at(0); |
- // Before translate the string, convert the input method id to legacy xkb id |
- // if possible. |
- // TODO(shuchen): the GetInputMethodLongName() method should be removed when |
- // finish the wrapping of xkb to extension. |
- base::string16 text = TranslateString( |
- extension_ime_util::MaybeGetLegacyXkbId(input_method.id())); |
+ base::string16 text = TranslateString(input_method.id()); |
if (text == standard_input_method_text || |
language_code == "de" || |
language_code == "fr" || |