From ed8fd002c53800b966fc1ef6115c2ff53fa042b1 Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Wed, 8 Apr 2015 21:30:53 -0300 Subject: Removes argument fixing of the i18n library #66 To introduce variables on the internationalization functions we should be able to pass extra arguments to the `i18n.t`. The way it was we could only pass the key and no more options to interpolate values. --- web-ui/app/js/views/i18n.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'web-ui/app/js/views') diff --git a/web-ui/app/js/views/i18n.js b/web-ui/app/js/views/i18n.js index b09490f5..568e7635 100644 --- a/web-ui/app/js/views/i18n.js +++ b/web-ui/app/js/views/i18n.js @@ -17,15 +17,11 @@ define(['i18next'], function(i18n) { 'use strict'; - var self = function(str) { - return i18n.t(str); - }; - - self.get = self; + var self = i18n.t; self.init = function(path) { i18n.init({detectLngQS: 'lang', fallbackLng: 'en', lowerCaseLng: true, getAsync: false, resGetPath: path + 'locales/__lng__/__ns__.json'}); - Handlebars.registerHelper('t', self.get.bind(self)); + Handlebars.registerHelper('t', self.bind(self)); }; return self; -- cgit v1.2.3