From 77c7e1aa939d00de021f216b480435286d2f0de1 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Thu, 15 May 2014 23:11:52 +0200 Subject: [PATCH] fix(i18n): recognize t() funcs --- dist/habitrpg-shared.js | 5 ++++- script/content.coffee | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 5920219ce4..44b51e3b14 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -9180,12 +9180,15 @@ moment = require('moment'); i18n = require('./i18n.coffee'); t = function(string, vars) { - return function(lang) { + var func; + func = function(lang) { if (vars == null) { vars = lang; } return i18n.t(string, vars, lang); }; + func.i18nLangFunc = true; + return func; }; diff --git a/script/content.coffee b/script/content.coffee index 476060d16d..4f8534bc6f 100644 --- a/script/content.coffee +++ b/script/content.coffee @@ -3,9 +3,11 @@ api = module.exports moment = require 'moment' i18n = require './i18n.coffee' t = (string, vars) -> - (lang) -> + func = (lang) -> vars ?= lang i18n.t(string, vars, lang) + func.i18nLangFunc = true #Trick to recognize this type of function + func ### ---------------------------------------------------------------