i18next.init(options, callback) // -> returns a Promise
init
. You can create additional instances using the createInstance function.t
function!i18next.use(module)
i18next.t(keys, options)
String
or multiple keys as an Array
of String
. The first one that resolves will be returned.i18next.exists(key, options)
t
function and returns true if a key exists.i18next.getFixedT(lng, ns, keyPrefix)
t
function that defaults to given language or namespace.lng
and ns
params could be arrays of languages or namespaces and will be treated as fallbacks in that case.keyPrefix
will be automatically applied to the returned t function. i.e.keyPrefix
option if you want to use keys with prefixed namespace notation:t
function override the languages or namespaces by passing them in options or by prepending namespace.i18next.changeLanguage(lng, callback) // -> returns a Promise
lng
to 'cimode' will cause the t
function to always return the key.i18next.language
i18next.resolvedLanguage
or i18next.languages[0]
.i18next.languages
i18next.resolvedLanguage
i18next.loadNamespaces(ns, callback) // -> returns a Promise
i18next.loadLanguages(lngs, callback) // -> returns a Promise
i18next.reloadResources() // -> returns a Promise
i18next.setDefaultNamespace(ns)
i18next.dir(lng)
rtl
or ltr
depending on languages read direction.i18next.format(data, format, lng)
interpolation.format
t function added on init.i18next.createInstance(options, callback)
i18next.cloneInstance(options)
i18next.off('name', myFunction);
i18next.off('name');
i18next.on('initialized', function(options) {})
i18next.on('languageChanged', function(lng) {})
i18next.on('loaded', function(loaded) {})
i18next.on('failedLoading', function(lng, ns, msg) {})
i18next.on('missingKey', function(lngs, namespace, key, res) {})
i18next.store
is only available on i18next after the init call.i18next.store.on('added', function(lng, ns) {})
i18next.store.on('removed', function(lng, ns) {})
i18next
or i18next.services.resourceStore
.i18next.getResource(lng, ns, key, options)
i18next.addResource(lng, ns, key, value, options)
i18next.addResources(lng, ns, resources)
i18next.addResourceBundle(lng, ns, resources, deep, overwrite)
i18next.hasResourceBundle(lng, ns)
i18next.getDataByLanguage(lng)
i18next.getResourceBundle(lng, ns)
i18next.removeResourceBundle(lng, ns)