https://github.com/sjsanc/i18next-webpack-locale-sync
Syncs i18next translations files against a master locale
https://github.com/sjsanc/i18next-webpack-locale-sync
i18next translation typescript webpack webpack-plugin
Last synced: 2 months ago
JSON representation
Syncs i18next translations files against a master locale
- Host: GitHub
- URL: https://github.com/sjsanc/i18next-webpack-locale-sync
- Owner: sjsanc
- Created: 2022-02-04T11:58:42.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-05-15T10:17:04.000Z (almost 3 years ago)
- Last Synced: 2025-01-16T19:27:18.106Z (4 months ago)
- Topics: i18next, translation, typescript, webpack, webpack-plugin
- Language: TypeScript
- Homepage:
- Size: 533 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# i18next-webpack-locale-sync
Syncs i18next translations files against a master locale.
## Install
```console
yarn add 18next-webpack-locale-sync --dev
```**webpack.config.js**
```js
import i18nextWebpackLocaleSync from "i18next-webpack-locale-sync"new i18nextWebpackLocaleSync({ masterLocale: 'en' }),
```The plugin expects your translation files to be in `/public/locales`. The master locale must match a folder name in this directory.
## Generating a CSV
A CSV with the combined translations for all your locales can be generated, organised with their object paths as dotnested strings. This is useful for comparisons, or if your translators prefer spreadsheets.
```console
common.hello,hello,hola,hallo
```Missing entries will be skipped
```console
validation.invalid.chars,not enough cowbell,,Nicht genug Kuhglocke
```## Options
```js
interface PluginOptions {
masterLocale: string; // The locale against which all others are compared
produceCSV?: boolean; // Generates a CSV of all the translation keys. Default false
csvOutDir?: string; // The CSV output filepath. Default is the root folder
csvOutFile?: string; // The CSV filename. Default is output.csv
verbose?: boolean; // Outputs information during the compilation phase
}
```