mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Move translator to helpers.js
This commit is contained in:
18
common/script/src/content/helpers.js
Normal file
18
common/script/src/content/helpers.js
Normal file
@@ -0,0 +1,18 @@
|
||||
require('coffee-script');
|
||||
import i18n from '../../../script/i18n.coffee';
|
||||
|
||||
export function translator(string, vars) {
|
||||
var func = function(lang) {
|
||||
if (vars == null) {
|
||||
vars = {
|
||||
a: 'a'
|
||||
};
|
||||
}
|
||||
return i18n.t(string, vars, lang);
|
||||
};
|
||||
|
||||
func.i18nLangFunc = true; // Trick to recognize this type of function
|
||||
|
||||
return func;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user