Skip to main content
Version: 5.x.x

Migrating to v5 (i18next)

In version 5, the core library was completely redesigned. Before you start, please read the general info about this new version.

Namespaces

Since Tolgee now supports namespaces you can now use them directly from i18next.

Because i18next doesn't let you have empty namespaces (""), you have to move your translations to some namespace in Tolgee Platform (i18next defaults to "translation"). Otherwise, Tolgee returns no translations.

Using static data

If you use static data you have to list the namespaces explicitly:

const tolgee = Tolgee()
.use(DevTools())
.use(I18nextPlugin())
.init({
staticData: {
'en:translation': ...,
'cs:translation': ...
}
});

Using BackendFetch

If you use the fetching plugin, you need to update your file structure like this:

├── i18n
│ └── translation
│ ├── en.json
│ └── de.json
├── index.html