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

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: 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 1fa88e7eab0c718b325839129207933e616ce9ce..ab6b68ec1597000258857115b7ef60690bce667d 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);
Greg Billock 2012/07/20 15:58:30 Should GetParentLocales not append "all" already?
groby-ooo-7-16 2012/07/20 22:59:54 No - see use in LoadMessageCatalogs. On 2012/07/2
+ 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 @@ ExtensionMessageBundle* 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) {

Powered by Google App Engine
This is Rietveld 408576698