mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 00:09:41 +00:00
Move translation function to separate module
This commit is contained in:
parent
5045ce3b2f
commit
8a06514c72
2 changed files with 12 additions and 8 deletions
|
|
@ -1,13 +1,8 @@
|
||||||
_ = require 'lodash'
|
|
||||||
api = module.exports
|
api = module.exports
|
||||||
|
|
||||||
|
_ = require 'lodash'
|
||||||
moment = require 'moment'
|
moment = require 'moment'
|
||||||
i18n = require '../i18n.coffee'
|
t = require './translation.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
|
|
||||||
|
|
||||||
###
|
###
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
|
|
|
||||||
9
common/script/content/translation.coffee
Normal file
9
common/script/content/translation.coffee
Normal 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
|
||||||
Loading…
Reference in a new issue