i18next.init(options, callback)
'cimode'
the output text will be the key. Make sure you use the 'en-US'
format, instead of underscores or similar.__false
will not trigger to load the fallbackLng
at all. See the Fallback docs.en-US
will be valid if en
is in supportedLngs
.en-US
: - 'all'
⇒ ['en-US', 'en', 'dev']
- 'currentOnly'
⇒ 'en-US'
- 'languageOnly'
⇒ 'en'
en-US
⇒ en-us
EN
⇒ en
, while leaving full locales like en-US
ns
option and no defaultNS
option is defined, the first namespace is used as defaultNS
option)saveMissing
(Works only if defaultValue is different from translated value. Only useful on initial development or when keeping code as source of truth not changing values outside of code. Only supported if backend supports it already)'current'
or 'all'
By default it uses the configured fallback language to save the missing keys to.
'current'
will use the current used/detected language (i18next.language) and 'all'
will save it to all languages included in i18next.languages.function(lngs, ns, key, fallbackValue, updateMissing, options) { }
used for custom missing key handling (needs saveMissing
set to true!)function(key, defaultValue) { // return value to display }
function(text, value) { return 'stringWithAlternativeValueOrUndefined' }
gets called in case a interpolation value is undefined. This method will not be called if the value is an empty string or nullfunction(key, value, options) {}
gets called if object was passed in as key but returnObjects
was set to falseinit()
inside a setTimeout
(default async behaviour). Set it to false
if your backend loads resources synchronously - that way, calling i18next.t()
after init()
is possible without relying on the initialization callback. This option only works for sync (blocking) loading backend, like i18next-fs-backend and i18next-sync-fs-backend!'.'
false
.':'
'_'
'_'
lng: 'cimode'
EMFILE
errors if ulimit -n
is exceeded (debug: true
must be set to see them). limiting parallelism usually makes loading all items substantially faster than allowing all reads to start before any have finished.initImmediate
when using a backend plugin allowing sync (blocking) loads.