fix(i18n): super fast fix for i18n issues, REVISIT, cc @lefnire

This commit is contained in:
Matteo Pagliazzi 2014-05-15 23:35:07 +02:00
parent 0d1d53fff6
commit f1e1ea11ef

View file

@ -14,11 +14,10 @@ module.exports =
locale = arguments[2]
locale = 'en' if (!locale? or (!module.exports.strings and !module.exports.translations[locale]))
string = if (!module.exports.strings) then module.exports.translations[locale][stringName] else module.exports.strings[stringName]
if string
if vars then _.template(string, vars) else string
_.template(string, (vars or {}))
else
stringNotFound = if (!module.exports.strings) then module.exports.translations[locale].stringNotFound else module.exports.strings.stringNotFound
_.template(stringNotFound, {string: stringName})