Move translation function to separate module

This commit is contained in:
Blade Barringer 2015-09-06 15:54:38 -05:00
parent 5045ce3b2f
commit 8a06514c72
2 changed files with 12 additions and 8 deletions

View file

@ -1,13 +1,8 @@
_ = require 'lodash'
api = module.exports
_ = require 'lodash'
moment = require 'moment'
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
t = require './translation.coffee'
###
---------------------------------------------------------------

View file

@ -0,0 +1,9 @@
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