Fix i18n of timer options

It is important to return something falsey in the case where there is
no translation.

// FREEBIE
This commit is contained in:
lilia
2017-04-12 16:27:10 -07:00
committed by Scott Nonnenberg
parent 590284e4cb
commit 75dbc27cfa

View File

@@ -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);