Convert translation function to js

This commit is contained in:
Blade Barringer
2015-09-06 16:20:14 -05:00
parent 245c7d48c8
commit 898ea845b3
4 changed files with 23 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
require('coffee-script');
var t = require('./translation.coffee');
var t = require('./translation.js');
var faq = {};

View File

@@ -2,7 +2,7 @@ api = module.exports
_ = require 'lodash'
moment = require 'moment'
t = require './translation.coffee'
t = require './translation.js'
###
---------------------------------------------------------------

View File

@@ -1,9 +0,0 @@
i18n = require '../i18n.coffee'
t = (string, vars) ->
func = (lang) ->
vars ?= {a: 'a'}
i18n.t(string, vars, lang)
func.i18nLangFunc = true #Trick to recognize this type of function
func
module.exports = t

View File

@@ -0,0 +1,21 @@
'use strict';
require('coffee-script');
var i18n = require('../i18n.coffee');
var t = function(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;
};
module.exports = t;