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,14 +19,14 @@ var l10n = l10n || {};
l10n.localizeElementFromTag = function(element, tag, opt_substitutions,
opt_asHtml) {
var translation = chrome.i18n.getMessage(tag, opt_substitutions);
if (translation) {
if (opt_asHtml) {
element.innerHTML = translation;
} else {
element.innerText = translation;
}
} else {
if (!translation) {
console.error('Missing translation for "' + tag + '":', element);
translation = tag; // Make errors more obvious
}
if (opt_asHtml) {
element.innerHTML = translation;
} else {
element.innerText = translation;
}
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