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

Unified Diff: chrome/common/extensions/extension_l10n_util.cc

Issue 22801019: Provide i18n support for descriptions in commands API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | chrome/common/extensions/extension_l10n_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_l10n_util.cc
diff --git a/chrome/common/extensions/extension_l10n_util.cc b/chrome/common/extensions/extension_l10n_util.cc
index 07e86cc4c6b940aeb115e3ee10810ea6e6518edc..ecb2574c914ec95df2856f1c860b3de2a2f2eba4 100644
--- a/chrome/common/extensions/extension_l10n_util.cc
+++ b/chrome/common/extensions/extension_l10n_util.cc
@@ -167,6 +167,18 @@ bool LocalizeManifest(const extensions::MessageBundle& messages,
if (!LocalizeManifestValue(keys::kLaunchWebURL, messages, manifest, error))
return false;
+ // Initialize description of commmands.
+ base::DictionaryValue* commands_handler = NULL;
+ if (manifest->GetDictionary(keys::kCommands, &commands_handler)) {
+ for (DictionaryValue::Iterator iter(*commands_handler); !iter.IsAtEnd();
+ iter.Advance()) {
+ key.assign(base::StringPrintf("commands.%s.description",
+ iter.key().c_str()));
+ if (!LocalizeManifestValue(key, messages, manifest, error))
+ return false;
+ }
+ }
+
// Add current locale key to the manifest, so we can overwrite prefs
// with new manifest when chrome locale changes.
manifest->SetString(keys::kCurrentLocale, CurrentLocaleOrDefault());
« no previous file with comments | « no previous file | chrome/common/extensions/extension_l10n_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698