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

Unified Diff: remoting/webapp/l10n.js

Issue 10879108: Use the i18n tag for strings that can't be translated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/l10n.js
diff --git a/remoting/webapp/l10n.js b/remoting/webapp/l10n.js
index 6bc92de810dfda2bd17c40bf7b267d26cf26d894..2df3e50525593428cd57719f0a5c4c9361ed512b 100644
--- a/remoting/webapp/l10n.js
+++ b/remoting/webapp/l10n.js
@@ -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;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698