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
No known key found for this signature in database
GPG key ID: A4931C09644C654B

View file

@ -5,7 +5,10 @@
'use strict'; 'use strict';
var json = window.env.locale_json; var json = window.env.locale_json;
window.i18n = function (message, substitutions) { 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) { if (substitutions instanceof Array) {
substitutions.forEach(function(sub) { substitutions.forEach(function(sub) {
s = s.replace(/\$.+?\$/, sub); s = s.replace(/\$.+?\$/, sub);