habitica/website/common/script/content/translation.js

12 lines
253 B
JavaScript
Raw Permalink Normal View History

2015-11-15 14:16:55 +00:00
import i18n from '../i18n';
2015-10-03 11:39:10 +00:00
2019-10-01 15:53:48 +00:00
export default function translator (string, vars = { a: 'a' }) {
2015-11-15 14:16:55 +00:00
function func (lang) {
2015-10-03 11:39:10 +00:00
return i18n.t(string, vars, lang);
2015-11-15 14:16:55 +00:00
}
2015-10-03 11:39:10 +00:00
func.i18nLangFunc = true; // Trick to recognize this type of function
return func;
2019-10-01 15:53:48 +00:00
}