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

Unified Diff: remoting/webapp/l10n.js

Issue 10703034: Remove 'Enable' button on unsupported platforms. Added 'No hosts' message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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: remoting/webapp/l10n.js
diff --git a/remoting/webapp/l10n.js b/remoting/webapp/l10n.js
index 467a5706059aece7afc0972de621a112c1c21ec1..c3893f94371345a0cd90d3d76f407806f89632ad 100644
--- a/remoting/webapp/l10n.js
+++ b/remoting/webapp/l10n.js
@@ -61,12 +61,24 @@ l10n.localize = function() {
/** @type {Element} */ var element = elements[i];
var substitutions = null;
for (var j = 1; j < 9; ++j) {
- var attr = 'i18n-value-' + j;
- if (element.hasAttribute(attr)) {
+ var value = 'i18n-value-' + j;
+ var valueName = 'i18n-value-name-' + j;
+ if (element.hasAttribute(value) || element.hasAttribute(valueName)) {
if (!substitutions) {
substitutions = [];
Wez 2012/06/28 23:00:20 Why do you do this? Can't you initialize substitut
Jamie 2012/06/28 23:28:57 Done.
}
- substitutions.push(element.getAttribute(attr));
+ if (element.hasAttribute(value)) {
+ substitutions.push(element.getAttribute(value));
+ } else {
+ var name = element.getAttribute(valueName);
+ var translation = chrome.i18n.getMessage(name);
+ if (translation) {
+ substitutions.push(translation);
+ } else {
+ console.error('Missing translation for substitution: ' + name);
+ substitutions.push(name);
+ }
+ }
} else {
break;
}

Powered by Google App Engine
This is Rietveld 408576698