OLD | NEW |
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 Loading... |
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 |
OLD | NEW |