@certik/i18next-lokalise
v2.0.1
Published
Internationalization framework for Next.js based on i18next, react-i18next, and Lokalise
Downloads
40
Keywords
Readme
Internationalization Framework for 2B and 2C
Install
Run the following command to install:
yarn add @certik/i18next-lokalise
Usage
For frontend:
import {
Trans,
useTranslation,
t,
getLocale,
withI18nApp,
i18next,
initReactI18next,
usePlurals
} from "@certik/i18next-lokalise/i18n";
For backend / server side:
import {
withI18n,
Translation,
reportMissing
} from "@certik/i18next-lokalise/i18n.ssr";
For script:
const {
downloadTranslations,
preprocessTranslations
} = require("@certik/i18next-lokalise/script");
Development
Edit source code in /src
directory. Support Javascript, Typescript, JSX, and TSX. Please note:
- For frontend-only code (React components, hooks), put it in
/src/i18n.tsx
only. - Javascript/Typescript files outside
/src
directory are generated based on code/src
directory, so don't modify manually.
Linting and Formatting
yarn lint
yarn format
Publish
Compile source code by running:
yarn build
Then publish package:
yarn publish --access public