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

Unified Diff: chrome/browser/extensions/extension_l10n_util.h

Issue 316013: Loading local resources uses improved fallback algorithm.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/browser/extensions/extension_l10n_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_l10n_util.h
===================================================================
--- chrome/browser/extensions/extension_l10n_util.h (revision 29776)
+++ chrome/browser/extensions/extension_l10n_util.h (working copy)
@@ -9,6 +9,7 @@
#include <set>
#include <string>
+#include <vector>
class DictionaryValue;
class Extension;
@@ -33,6 +34,15 @@
std::set<std::string>* valid_locales,
std::string* error);
+// Converts all - into _, to be consistent with ICU and file system names.
+std::string NormalizeLocale(const std::string& locale);
+
+// Produce a vector of parent locales for given locale.
+// It includes the current locale in the result.
+// sr_Cyrl_RS generates sr_Cyrl_RS, sr_Cyrl and sr.
+void GetParentLocales(const std::string& current_locale,
+ std::vector<std::string>* parent_locales);
+
// Adds valid locales to the extension.
// 1. Do nothing if _locales directory is missing (not an error).
// 2. Get list of Chrome locales.
@@ -56,8 +66,11 @@
const std::set<std::string>& valid_locales,
std::string* error);
-// Returns relative l10n path to the resource.
-FilePath GetL10nRelativePath(const FilePath& relative_resource_path);
+// Returns relative l10n paths to the resource.
+// Returned vector starts with more specific locale path, and ends with the
+// least specific one.
+void GetL10nRelativePaths(const FilePath& relative_resource_path,
+ std::vector<FilePath>* l10n_paths);
} // namespace extension_l10n_util
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698