From 8cef27d6980e5ef5024377c3ffa1b5e464f7f3d8 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Mon, 22 Feb 2016 01:57:22 +0100 Subject: [PATCH] Fix jsDoc on i18n.t() no issue - my IDE has been moaning at me for every usage of i18n.t that didn't have 2 args - this uses the optional notation and expects an object instead of JSON (JSON requires keys to be quoted) --- core/server/i18n.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/server/i18n.js b/core/server/i18n.js index 18d67d8484..942bc6ef51 100644 --- a/core/server/i18n.js +++ b/core/server/i18n.js @@ -17,10 +17,10 @@ I18n = { * Helper method to find and compile the given data context with a proper string resource. * * @param {string} path Path with in the JSON language file to desired string (ie: "errors.init.jsNotBuilt") - * @param {json} context + * @param {object} [bindings] * @returns {string} */ - t: function t(path, context) { + t: function t(path, bindings) { var string = I18n.findString(path), msg; @@ -32,11 +32,11 @@ I18n = { string.forEach(function (s) { var m = new MessageFormat(s, currentLocale); - msg.push(m.format(context)); + msg.push(m.format(bindings)); }); } else { msg = new MessageFormat(string, currentLocale); - msg = msg.format(context); + msg = msg.format(bindings); } return msg;