feature #3748: Add tr handlebars helper

This commit is contained in:
Daniel Molina committed 2015-04-15 18:50:54 +02:00
1 parent 9dd72cf4b5
commit e2a205ecbf
2 files changed
+26

No files matched your search

@@ -0,0 +1,11 @@
define(function(require) {
var Handlebars = require('hbs/handlebars');
var Locale = require('utils/locale');
var tr = function(context, options) {
return Locale.tr(context);
};
Handlebars.registerHelper('tr', tr);
return tr;
})
+15
View File
@@ -0,0 +1,15 @@
define(function(require) {
var tr = function (str) {
// TODO Add locale from the locale folder
// var tmp = locale[str];
var tmp;
if (tmp == null || tmp == "") {
tmp = str;
}
return tmp;
};
return {
'tr': tr
}
});