Skip to main content

API (i18next)

Full integration

function withTolgee(i18next, tolgeeConfig)

Ensures complete integration between i18next and Tolgee.

Custom integration

If you need more granular control of what is applied to i18next instance, you can use following functions manually instead of using withTolgee which uses them all.

function tolgeeBackend(tolgee)

Creates Tolgee backend plugin for i18next.

  • tolgee - Tolgee instance

function tolgeeProcessor(tolgee)

Creates Tolgee postProcessor plugin for i18next. Applies wrapping to each translation, so it's detectable for in-context in dev mode.

  • tolgee - Tolgee instance

function tolgeeApply(tolgee, i18next)

Registers necessary callbacks (tolgee.onTranslationChange and i18next.on('languageChanged')) on Tolgee instance and on i18next.

  • tolgee - Tolgee instance
  • i18next - i18next instance

function tolgeeOptions(options)

Extends i18next's InitOptions with options that are necessary for Tolgee to work properly. We need to globally enable our tolgeeProcessor and also react on store event added, so the UI is refreshed when some translation is changed through in-context edit.