-
Notifications
You must be signed in to change notification settings - Fork 8
Multilingual support
Alexey Gordeyev edited this page Apr 17, 2015
·
20 revisions
Set your default language in config/configuration.js
module.exports = {
debug: false,
language: "en",
...
}Dictionaries located config/locales/*, writed in the YAML Format.
.
`-- config
`-- locales
|-- en.yml
|-- ...
`-- ru.yml
Parameters:
- key String - translation key (reqired)
- val String - default value (optional)
module.exports = {
...
'index': function(req, res, next) {
var title = res.locals.t('main.title');
...
}
} <h1><%- t('main.title') %></h1> <a href="/?language=ru">RU</a>
<a href="/?language=en">EN</a>