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

Side by Side Diff: chrome/browser/extensions/extension_l10n_util.cc

Issue 256022: Loads local resources from current locale subtree if available, if not it fal... (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_l10n_util.h" 5 #include "chrome/browser/extensions/extension_l10n_util.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // Only default catalog has to be present. This is not an error. 137 // Only default catalog has to be present. This is not an error.
138 app_catalog.reset(new DictionaryValue); 138 app_catalog.reset(new DictionaryValue);
139 error->clear(); 139 error->clear();
140 } 140 }
141 141
142 return ExtensionMessageBundle::Create(*default_catalog, 142 return ExtensionMessageBundle::Create(*default_catalog,
143 *app_catalog, 143 *app_catalog,
144 error); 144 error);
145 } 145 }
146 146
147 FilePath GetL10nRelativePath(const FilePath& relative_resource_path) {
148 // Get locale relative path.
149 static std::string current_locale = l10n_util::GetApplicationLocale(L"");
150 std::replace(current_locale.begin(), current_locale.end(), '-', '_');
151
152 FilePath locale_relative_path;
153 return locale_relative_path
154 .AppendASCII(Extension::kLocaleFolder)
155 .AppendASCII(current_locale)
156 .Append(relative_resource_path);
157 }
158
147 } // namespace extension_l10n_util 159 } // namespace extension_l10n_util
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_l10n_util.h ('k') | chrome/browser/extensions/extension_l10n_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698