mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 08:21:07 +00:00
chore(env.t): expose basic env.t() implementation for 'en' so mobile app
can use the function
This commit is contained in:
parent
c5bfe57344
commit
da548ff43f
1 changed files with 7 additions and 0 deletions
|
|
@ -255,3 +255,10 @@ module.exports.locals = function(req, res, next) {
|
|||
next();
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.enTranslations = function(stringName, vars){
|
||||
var language = {code:'en'};
|
||||
var string = translations[language.code][stringName];
|
||||
if(!string) return _.template(translations[language.code].stringNotFound, {string: stringName});
|
||||
return vars === undefined ? string : _.template(string, vars);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue