t
tiny translation helper.
Installation
$ component install component/t
API
t(string, [object], [lang])
Return a translatable string
, with optional
substitutions keyed in object
using language lang
.
var t = ; ;// => "Hello" ;// => "Hello Tobi"
t.lang()
Get the current language code, for example "en".
t.lang(code)
Set language code
.
t.CODE = object
Define translations, for example:
tes = 'Hello {name}': 'Hola {name}'; ;// => "Hello Tobi" tlang'es';should;// => "Hola Tobi"
License
MIT