summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/resources
diff options
context:
space:
mode:
authorcira@chromium.org <cira@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 19:38:49 +0000
committercira@chromium.org <cira@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 19:38:49 +0000
commit75e126b937df6fcf5590f607adb460099211fb5a (patch)
treedea2e8c33b6777b36df3435179fd9e6840b77710 /chrome/renderer/resources
parent99a19b7411d408c7471b3ee2c452f06f4d09259d (diff)
downloadchromium_src-75e126b937df6fcf5590f607adb460099211fb5a.zip
chromium_src-75e126b937df6fcf5590f607adb460099211fb5a.tar.gz
chromium_src-75e126b937df6fcf5590f607adb460099211fb5a.tar.bz2
Implementing chrome.i18n.getMessage call, that loads message from the extension catalog, and if necessary replaces placeholders (up to 9).
I have 3 forms of getMessage call: getMessage("name") for simple messages without placeholders. getMessage("name", "one param") for messages with only one placeholder. getMessage("name", ["one", "two"]) for messages with only one or more placeholders. getMessage returns string. BUG=12131 TEST=Load samples/i18n extension (switch Chrome to sr locale) and observe ext. name, description and toolstrip texts should be in Serbian. Review URL: http://codereview.chromium.org/225009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27393 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/resources')
-rw-r--r--chrome/renderer/resources/extension_process_bindings.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/renderer/resources/extension_process_bindings.js b/chrome/renderer/resources/extension_process_bindings.js
index ff2fddd..710dad8 100644
--- a/chrome/renderer/resources/extension_process_bindings.js
+++ b/chrome/renderer/resources/extension_process_bindings.js
@@ -20,6 +20,7 @@ var chrome = chrome || {};
native function GetNextRequestId();
native function OpenChannelToTab();
native function GetRenderViewId();
+ native function GetL10nMessage();
if (!chrome)
chrome = {};
@@ -323,6 +324,11 @@ var chrome = chrome || {};
return tabIdProxy;
}
+ apiFunctions["i18n.getMessage"].handleRequest =
+ function(message_name, placeholders) {
+ return GetL10nMessage(message_name, placeholders);
+ }
+
setupPageActionEvents(extensionId);
setupBrowserActionEvent(extensionId);
setupToolstripEvents(GetRenderViewId());