mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 19:59:02 +08:00
24 lines
605 B
TypeScript
24 lines
605 B
TypeScript
import * as i18next from 'i18next';
|
|
import * as Backend from 'i18next-node-fs-backend';
|
|
|
|
var options = {
|
|
backend: {
|
|
// path where resources get loaded from
|
|
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
|
|
|
// path to post missing resources
|
|
addPath: '/locales/{{lng}}/{{ns}}.missing.json',
|
|
|
|
// jsonIndent to use when storing json files
|
|
jsonIndent: 2
|
|
}
|
|
};
|
|
|
|
i18next.use(Backend).init(options);
|
|
i18next.use(Backend).init({ backend: options.backend });
|
|
|
|
var backend = new Backend(null, options.backend);
|
|
|
|
backend = new Backend();
|
|
backend.init(options.backend);
|