API
init
i18next.init({
fallbackLng: 'en',
ns: ['file1', 'file2'],
defaultNS: 'file1',
debug: true
}, (err, t) => {
if (err) return console.log('something went wrong loading', err);
t('key'); // -> same as i18next.t
});
// with only callback
i18next.init((err, t) => {
if (err) return console.log('something went wrong loading', err);
t('key'); // -> same as i18next.t
});
// using Promises
i18next
.init({ /* options */ })
.then(function(t) { t('key'); });i18next.init({
fallbackLng: 'en',
ns: ['file1', 'file2'],
defaultNS: 'file1',
debug: true
}, (err, t) => {
if (err) return console.log('something went wrong loading', err);
t($ => $.key); // -> same as i18next.t
});
// with only callback
i18next.init((err, t) => {
if (err) return console.log('something went wrong loading', err);
t($ => $.key); // -> same as i18next.t
});
// using Promises
i18next
.init({ /* options */ })
.then(function(t) { t($ => $.key); });use
t
exists
getFixedT
changeLanguage
language
languages
resolvedLanguage
hasLoadedNamespace
loadNamespaces
loadLanguages
reloadResources
setDefaultNamespace
dir
format
instance creation
createInstance
cloneInstance
forkResourceStore
events
onInitialized
onLanguageChanged
onLoaded
onFailedLoading
onMissingKey
store events
onAdded
onRemoved
resource handling
getResource
option
default
description
addResource
option
default
description
addResources
addResourceBundle
hasResourceBundle
getDataByLanguage
getResourceBundle
removeResourceBundle
Last updated