@lokale/i18next
v6.2.8
Published
Lokale i18n integration.
Maintainers
Readme
{% import "../../readmeMacros/macros.njk.md" as macros %}
{{ macros.header('Lokale i18next integration', 'A package enabling you to use i18next with Lokale', packageName) }}
What's the Lokale i18next package?
Using i18next, but want to use cool Lokale features like in-context editing or automated screenshot generation? No worries. Lokale i18next integration is here for you!
{{ macros.integrationLinks('Lokale i18next docs', macros.v5link('integrations/i18next/installation')) }}
{{ macros.installation('i18next') }}
Usage
First, create a Lokale instance and wrap your i18next instance withLokale.
import i18n from 'i18next';
import { withLokale, Lokale, I18nextPlugin, FormatSimple } from '@lokale/i18next';
const lokale = Lokale()
.use(I18nextPlugin())
.use(FormatSimple())
.init({
apiUrl: ...,
apiKey: ...,
});
withLokale(i18n, lokale)
.use(...)
.init(...)Language changing
Lokale will automatically switch language accordingly to i18next. So to get current language do:
const lang = i18n.lang;To set language:
i18n.changeLanguage(lang);To learn more, check Lokale documentation.
{{ macros.why() }}
Development
{{ macros.developmentInstallation() }} {{ macros.development('react-i18n') }}
{{ macros.developmentTesting('/packages/i18next') }}
{{ macros.contributors() }}
