| Index: remoting/webapp/crd/js/l10n.js
|
| diff --git a/remoting/webapp/crd/js/l10n.js b/remoting/webapp/crd/js/l10n.js
|
| index 1774fb92acb30212ed1a7a4bcae1c9538b797a57..4f48b914ce4732deca25ed2011055a090cd25a82 100644
|
| --- a/remoting/webapp/crd/js/l10n.js
|
| +++ b/remoting/webapp/crd/js/l10n.js
|
| @@ -28,15 +28,22 @@ l10n.getTranslationOrError = function(tag, opt_substitutions) {
|
| * and an optional set of substitutions.
|
| *
|
| * @param {Element} element The element to localize.
|
| - * @param {string} tag The localization tag.
|
| + * @param {string|remoting.Error} tagOrError The localization tag or
|
| + * an Error object containing the tag.
|
| * @param {(string|Array)=} opt_substitutions An optional set of substitution
|
| * strings corresponding to the "placeholders" attributes in messages.json.
|
| * @param {boolean=} opt_asHtml If true, set innerHTML instead of innerText.
|
| * This parameter should be used with caution.
|
| * @return {boolean} True if the localization was successful; false otherwise.
|
| */
|
| -l10n.localizeElementFromTag = function(element, tag, opt_substitutions,
|
| +l10n.localizeElementFromTag = function(element, tagOrError, opt_substitutions,
|
| opt_asHtml) {
|
| + if (tagOrError == null) {
|
| + return false;
|
| + }
|
| + var tag = typeof tagOrError == 'string' ?
|
| + /** @type {string} */ (tagOrError) :
|
| + tagOrError.getTag();
|
| var translation = l10n.getTranslationOrError(tag, opt_substitutions);
|
| if (opt_asHtml) {
|
| element.innerHTML = translation;
|
|
|