internationalization
setup
i18n = ; app;
directory layout
files under then same directory will be merged(file name does not matter)
locales
├── en
│ ├── foo.ini
│ └── bar.ini
└── zh
└── index.ini
usage
span= _("Hello {username}", {username: username})span= _("Hello {1}", username)input(placeholder=_("Password") type="password")
Hello {username} = Guten Tag {username}Hello {1} = Guten Tag {1}Password = Passwort
namespace
span= _("profile:Hello {username}", {username: username})
[profile]Hello {username} = Guten Tag {username}
client side
app;
include in html
more options:
cookie
defaultlang
path
default/i18n.js
exportAs
defaulti18n
angularjs intergartion
app;
include in html
using filter
{{'delete warning'| translate:resource.name}}{{'action:delete' | translate}}
using service
app
generate/update language files(TBD)
directory: 'locales'views: 'views/**.jade'
grunt i18n will scan the view direcotry for _()
and __()
$ grunt i18n de