/// /// /// /// /// /// import * as i18n from 'i18next'; i18n.init({ debug: true, resources: { en: { translation: { helloWorld: 'Hello, world!' } }, ru: { translation: { helloWorld: 'Привет, мир!' } } }, lng: 'en', fallbackLng: 'ru', ns: 'translation', defaultNS: 'translation', fallbackNS: 'translation', whitelist: ['en'], lowerCaseLng: false, load: 'languageOnly', preload: ['ru', 'en'], keySeparator: '.', nsSeparator: ':', pluralSeparator: '_', contextSeparator: '_', saveMissing: true, saveMissingTo: 'all', missingKeyHandler: (lng:string, ns:string, key:string, fallbackValue:string) => { console.log('Lng: ' + lng + ', ns: ' + ns + ', key' + key + ', fallbackValue: ' + fallbackValue); }, parseMissingKeyHandler: (key:string) => { console.log(key); }, appendNamespaceToMissingKey: true, returnNull: false, returnEmptyString: false, returnObjects: false, returnedObjectHandler: (key:string, value:string, options:any) => { }, joinArrays: '\n', overloadTranslationOptionHandler: (args:any[]) => { return {} }, interpolation: {}, detection: null, backend: null, cache: null }); i18n.t('helloWorld', { defaultValue: 'default', count: 10 });