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

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

Issue 10790087: [Web Intents] Localization of intent titles for CWS suggestions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to HEAD, adjust namespace/include Created 8 years, 5 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_l10n_util.cc
diff --git a/chrome/common/extensions/extension_l10n_util.cc b/chrome/common/extensions/extension_l10n_util.cc
index 5f94c4dff81d1a68c917a7a62dd454eff4828ac3..f8617888d0d31be661a5d6cb8fcf317fb2c8965c 100644
--- a/chrome/common/extensions/extension_l10n_util.cc
+++ b/chrome/common/extensions/extension_l10n_util.cc
@@ -237,6 +237,15 @@ void GetAllLocales(std::set<std::string>* all_locales) {
}
}
+void GetAllFallbackLocales(const std::string& application_locale,
+ const std::string& default_locale,
+ std::vector<std::string>* all_fallback_locales) {
+ DCHECK(all_fallback_locales);
+ if (!application_locale.empty() && application_locale != default_locale)
+ l10n_util::GetParentLocales(application_locale, all_fallback_locales);
+ all_fallback_locales->push_back(default_locale);
+}
+
bool GetValidLocales(const FilePath& locale_path,
std::set<std::string>* valid_locales,
std::string* error) {
@@ -298,11 +307,9 @@ extensions::MessageBundle* LoadMessageCatalogs(
const std::string& application_locale,
const std::set<std::string>& valid_locales,
std::string* error) {
- // Order locales to load as current_locale, first_parent, ..., default_locale.
std::vector<std::string> all_fallback_locales;
- if (!application_locale.empty() && application_locale != default_locale)
- l10n_util::GetParentLocales(application_locale, &all_fallback_locales);
- all_fallback_locales.push_back(default_locale);
+ GetAllFallbackLocales(application_locale, default_locale,
+ &all_fallback_locales);
std::vector<linked_ptr<DictionaryValue> > catalogs;
for (size_t i = 0; i < all_fallback_locales.size(); ++i) {
« no previous file with comments | « chrome/common/extensions/extension_l10n_util.h ('k') | chrome/common/extensions/extension_l10n_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698