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

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

Issue 170015: This change enables Chrome to load locale information for the extension. It d... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
Index: chrome/common/extensions/extension.cc
===================================================================
--- chrome/common/extensions/extension.cc (revision 23230)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -67,6 +67,8 @@
int Extension::id_counter_ = 0;
const char Extension::kManifestFilename[] = "manifest.json";
+const char Extension::kLocaleFolder[] = "_locales";
+const char Extension::kMessagesFilename[] = "messages";
Aaron Boodman 2009/08/19 03:00:49 I asked this in a previous review, but it looks to
// A list of all the keys allowed by themes.
static const wchar_t* kValidThemeKeys[] = {
@@ -915,6 +917,18 @@
}
}
+ // Initialize default locale (if present).
+ if (source.HasKey(keys::kDefaultLocale)) {
+ std::string default_locale;
+ if (!source.GetString(keys::kDefaultLocale, &default_locale)) {
+ *error = errors::kInvalidDefaultLocale;
+ return false;
+ }
+ // Normalize underscores to hyphens.
+ std::replace(default_locale.begin(), default_locale.end(), '_', '-');
+ set_default_locale(default_locale);
+ }
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698