@voilab/i18next-moleculer-backend
v0.0.5
Published
i18next Moleculer backend, load translations from a Moleculer service
Downloads
117
Readme
i18next-moleculer-backend
Usage
const { i18nMixin } = require('i18next-moleculer-backend');
module.exports = {
name: 'i18n',
mixins: [ i18nMixin ],
settings: {
i18next: {
ns: 'mynamespace',
defaultNS: 'mynamespace'
}
},
actions: {
hello(ctx) {
const t = this.getT(ctx));
return t('hello');
}
}
};