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

Unified Diff: chrome/common/extensions/docs/static/i18n.html

Issue 225009: Implementing chrome.i18n.getMessage call, that loads message from the extensi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/static/i18n.html
===================================================================
--- chrome/common/extensions/docs/static/i18n.html (revision 27238)
+++ chrome/common/extensions/docs/static/i18n.html (working copy)
@@ -3,7 +3,8 @@
<!-- BEGIN AUTHORED CONTENT -->
<p id="classSummary">
Use the <code>chrome.i18n</code> module to manipulate the i18n related browser
-settings, such as the accept languages.
+settings, such as the accept languages, or to get localized messages for current
+locale.
</p>
<h3 id="overview-examples">Examples</h3>
@@ -21,4 +22,17 @@
})
}
</pre>
+
+<p>
+The following code gets localized message from the browser and displays it as a
+string. It replaces two placeholders within the message with values arg1 and
+arg2.
+</p>
+
+<pre>
+function getMessage() {
+ var message = chrome.i18n.getMessage("click_here", ["arg1", "arg2"]);
+ document.getElementById("languageSpan").innerHTML = message;
+}
+</pre>
<!-- END AUTHORED CONTENT -->

Powered by Google App Engine
This is Rietveld 408576698