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

Side by Side Diff: remoting/webapp/me2mom/l10n.js

Issue 7635012: Host process i18n and Linux implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change UIStrings to UiStrings. Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2011 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 5
6 /**
7 * Localize the document by replacing innerText of nodes with an i18n-content
8 * attribute with the corresponding localized string.
9 */
10
11 var l10n = l10n || {}; 6 var l10n = l10n || {};
12 7
13 /** 8 /**
14 * Localize an element by setting its innerText according to its i18n-content 9 * Localize an element by setting its innerText according to its i18n-content
15 * attribute, and an optional set of substitutions. 10 * attribute, and an optional set of substitutions.
16 * @param {Element} element The element to localize. 11 * @param {Element} element The element to localize.
17 * @param {string=} opt_substitutions An optional set of substitution strings 12 * @param {string=} opt_substitutions An optional set of substitution strings
18 * corresponding to the "placeholders"attributes in messages.json. 13 * corresponding to the "placeholders"attributes in messages.json.
19 * @return {boolean} True if the localization was successful; false otherwise. 14 * @return {boolean} True if the localization was successful; false otherwise.
20 */ 15 */
(...skipping 11 matching lines...) Expand all
32 /** 27 /**
33 * Localize all tags with the i18n-content attribute. 28 * Localize all tags with the i18n-content attribute.
34 */ 29 */
35 l10n.localize = function() { 30 l10n.localize = function() {
36 var elements = document.querySelectorAll('[i18n-content]'); 31 var elements = document.querySelectorAll('[i18n-content]');
37 for (var i = 0; i < elements.length; ++i) { 32 for (var i = 0; i < elements.length; ++i) {
38 var element = elements[i]; 33 var element = elements[i];
39 l10n.localizeElement(element); 34 l10n.localizeElement(element);
40 } 35 }
41 }; 36 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698