|
CL is the same as http://codereview.chromium.org/173487, but had to be moved to new CL number because I switched machines.
Implemented the rest of loading/parsing logic for extension i18n:
1. Loading message catalogs for default and application locale.
2. Parsing JSON and replacing placeholders with actual content within a message.
3. Creating unified dictionary (union of default and application dictionaries,
where application dict. has priority for common messages).
New class ExtensionMessageBundle holds new dictionary, and parses data. It's
injected into Extension.
ExtensionMessageHandler::ReplaceVariablesInString can replace both
$placeholders$ and __MSG_messages__ in given string (HTML, manifest, actual
message string...).
Implemented actual manifest name/description replacement too, as an example.
Extension is now pretty agnostic about localization, and this makes it easier to use message bundles
with things that are not extensions...
BUG= 12131
Total comments: 34
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+936 lines, -231 lines) |
Patch |
 |
M |
chrome/browser/extensions/extension_file_util.h
|
View
|
|
4 chunks |
+14 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/extensions/extension_file_util.cc
|
View
|
1
2
3
|
5 chunks |
+46 lines, -19 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/extensions/extension_file_util_unittest.cc
|
View
|
1
2
3
|
3 chunks |
+21 lines, -51 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/extensions/extension_l10n_util.h
|
View
|
|
3 chunks |
+19 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/extensions/extension_l10n_util.cc
|
View
|
1
2
3
|
5 chunks |
+69 lines, -15 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/extensions/extension_l10n_util_unittest.cc
|
View
|
1
2
3
|
1 chunk |
+75 lines, -89 lines |
0 comments
|
Download
|
 |
A |
chrome/browser/extensions/extension_message_bundle.h
|
View
|
1
2
3
|
1 chunk |
+110 lines, -0 lines |
0 comments
|
Download
|
 |
A |
chrome/browser/extensions/extension_message_bundle.cc
|
View
|
1
2
3
|
1 chunk |
+256 lines, -0 lines |
0 comments
|
Download
|
 |
A |
chrome/browser/extensions/extension_message_bundle_unittest.cc
|
View
|
1
2
3
|
1 chunk |
+288 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/extensions/extension_ui_unittest.cc
|
View
|
1
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/chrome.gyp
|
View
|
1
2
3
|
3 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/common/extensions/extension.h
|
View
|
1
2
|
3 chunks |
+9 lines, -18 lines |
0 comments
|
Download
|
 |
M |
chrome/common/extensions/extension.cc
|
View
|
1
2
3
|
2 chunks |
+12 lines, -14 lines |
0 comments
|
Download
|
 |
M |
chrome/common/extensions/extension_unittest.cc
|
View
|
|
1 chunk |
+0 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/_locales/en_US/messages.json
|
View
|
1
2
3
|
1 chunk |
+6 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/_locales/sr/messages.json
|
View
|
1
2
3
|
1 chunk |
+6 lines, -3 lines |
0 comments
|
Download
|
Total messages: 10 (0 generated)
|