mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Convert common files to es2015.
This commit is contained in:
@@ -1,20 +1,11 @@
|
||||
'use strict';
|
||||
import i18n from '../i18n';
|
||||
|
||||
var i18n = require('../i18n');
|
||||
|
||||
var t = function(string, vars) {
|
||||
var func = function(lang) {
|
||||
if (vars == null) {
|
||||
vars = {
|
||||
a: 'a'
|
||||
};
|
||||
}
|
||||
export default function translator (string, vars = { a: 'a' }) {
|
||||
function func (lang) {
|
||||
return i18n.t(string, vars, lang);
|
||||
};
|
||||
}
|
||||
|
||||
func.i18nLangFunc = true; // Trick to recognize this type of function
|
||||
|
||||
return func;
|
||||
};
|
||||
|
||||
module.exports = t;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user