Use the i18n tag for strings that can't be translated.

This makes errors easier to spot during QA and also means that end-users aren't completely without context if one slips through (assuming our tag names are sensible).

BUG=


Review URL: https://chromiumcodereview.appspot.com/10879108

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153630 0039d316-1c4b-4281-b951-d872f2087c98
parent 8953fe29
...@@ -19,15 +19,15 @@ var l10n = l10n || {}; ...@@ -19,15 +19,15 @@ var l10n = l10n || {};
l10n.localizeElementFromTag = function(element, tag, opt_substitutions, l10n.localizeElementFromTag = function(element, tag, opt_substitutions,
opt_asHtml) { opt_asHtml) {
var translation = chrome.i18n.getMessage(tag, opt_substitutions); var translation = chrome.i18n.getMessage(tag, opt_substitutions);
if (translation) { if (!translation) {
console.error('Missing translation for "' + tag + '":', element);
translation = tag; // Make errors more obvious
}
if (opt_asHtml) { if (opt_asHtml) {
element.innerHTML = translation; element.innerHTML = translation;
} else { } else {
element.innerText = translation; element.innerText = translation;
} }
} else {
console.error('Missing translation for "' + tag + '":', element);
}
return translation != null; return translation != null;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment