Index: ui/webui/resources/js/local_strings.js |
diff --git a/ui/webui/resources/js/local_strings.js b/ui/webui/resources/js/local_strings.js |
index 3209612e2ff518f9e7cd5ce93b2240bcdba7d853..54585fe2e8de7a0dedb7e2ae1ae8ec91e318446d 100644 |
--- a/ui/webui/resources/js/local_strings.js |
+++ b/ui/webui/resources/js/local_strings.js |
@@ -9,7 +9,7 @@ |
* {@code templateData}. This class provides a simpler interface to access those |
* strings. |
* |
- * @param {Object} opt_templateData Optional object containing translated |
+ * @param {Object=} opt_templateData Optional object containing translated |
* strings. If this is not supplied during construction, it can be |
* assigned to the templateData property after construction. If all else |
* fails, the value of window.templateDate will be used. |
@@ -26,7 +26,8 @@ function LocalStrings(opt_templateData) { |
* Returns a formatted string where $1 to $9 are replaced by the second to the |
* tenth argument. |
* @param {string} s The format string. |
- * @param {...string} The extra values to include in the formatted output. |
+ * @param {Arguments} args The extra values to include in the formatted |
+ * output. |
* @return {string} The string after format substitution. |
*/ |
function replaceArgs(s, args) { |
@@ -49,18 +50,18 @@ function trimAccelerators(s) { |
LocalStrings.prototype = { |
/** |
* The template data object. |
- * @type {Object} |
+ * @type {Object|undefined} |
*/ |
- templateData: null, |
+ templateData: undefined, |
arv (Not doing code reviews)
2014/07/16 18:33:03
why not null?
Dan Beam
2014/07/19 02:28:40
because this is the actual type, see ctor function
|
/** |
* Gets a localized string by its id. |
- * @param {string} s The ID of the string we want. |
+ * @param {string} id The ID of the string we want. |
* @return {string} The localized string. |
*/ |
getString: function(id) { |
// TODO(arv): We should not rely on a global variable here. |
- var templateData = this.templateData || window.templateData; |
+ var templateData = this.templateData || window['templateData']; |
arv (Not doing code reviews)
2014/07/16 18:33:03
Sad :'(
Dan Beam
2014/07/19 02:28:40
actually, this may not be necessary now that I've
|
var str = templateData[id]; |
// TODO(jhawkins): Change to console.error when all errors are fixed. |
if (!str) |
@@ -72,7 +73,8 @@ LocalStrings.prototype = { |
* Returns a formatted localized string where $1 to $9 are replaced by the |
* second to the tenth argument. |
* @param {string} id The ID of the string we want. |
- * @param {...string} The extra values to include in the formatted output. |
+ * @param {...string} var_args The extra values to include in the formatted |
+ * output. |
* @return {string} The formatted string. |
*/ |
getStringF: function(id, var_args) { |