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 // This file declares extension specific l10n utils. | 5 // This file declares extension specific l10n utils. |
6 | 6 |
7 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_L10N_UTIL_H_ | 7 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_L10N_UTIL_H_ |
8 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_L10N_UTIL_H_ | 8 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_L10N_UTIL_H_ |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 23 matching lines...) Expand all Loading... |
34 // 1. Do nothing if _locales directory is missing (not an error). | 34 // 1. Do nothing if _locales directory is missing (not an error). |
35 // 2. Get list of Chrome locales. | 35 // 2. Get list of Chrome locales. |
36 // 3. Enumerate all subdirectories of _locales directory. | 36 // 3. Enumerate all subdirectories of _locales directory. |
37 // 4. Intersect both lists, and add intersection to the extension. | 37 // 4. Intersect both lists, and add intersection to the extension. |
38 // Returns false if any of supplied locales don't match chrome list of locales. | 38 // Returns false if any of supplied locales don't match chrome list of locales. |
39 // Fills out error with offending locale name. | 39 // Fills out error with offending locale name. |
40 bool AddValidLocales(const FilePath& locale_path, | 40 bool AddValidLocales(const FilePath& locale_path, |
41 Extension* extension, | 41 Extension* extension, |
42 std::string* error); | 42 std::string* error); |
43 | 43 |
| 44 // Loads messages file for default locale, and application locale (application |
| 45 // locale doesn't have to exist). |
| 46 // It creates simplified in-memory representation of name-value pairs, where |
| 47 // value part is actual message with placeholders resolved. |
| 48 // Returns true if it can load default locale messages file, and all messages |
| 49 // are valid. |
| 50 bool LoadMessageCatalogs(const FilePath& locale_path, |
| 51 Extension* extension, |
| 52 std::string* error); |
| 53 |
44 } // namespace extension_l10n_util | 54 } // namespace extension_l10n_util |
45 | 55 |
46 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_L10N_UTIL_H_ | 56 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_L10N_UTIL_H_ |
OLD | NEW |