From 75dbc27cfa29c411399a96a530efb69b0454281a Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 12 Apr 2017 16:27:10 -0700 Subject: [PATCH] Fix i18n of timer options It is important to return something falsey in the case where there is no translation. // FREEBIE --- js/i18n.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/i18n.js b/js/i18n.js index 7e5c50cf6..e3054f7a5 100644 --- a/js/i18n.js +++ b/js/i18n.js @@ -5,7 +5,10 @@ 'use strict'; var json = window.env.locale_json; window.i18n = function (message, substitutions) { - var s = json[message] ? json[message].message : message; + if (!json[message]) { + return; + } + var s = json[message].message; if (substitutions instanceof Array) { substitutions.forEach(function(sub) { s = s.replace(/\$.+?\$/, sub);