i18next-webpack-locale-sync
v1.0.3
Published
Syncs i18next translations files against a master locale
Downloads
6
Readme
i18next-webpack-locale-sync
Syncs i18next translations files against a master locale.
Install
yarn add 18next-webpack-locale-sync --dev
webpack.config.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.
common.hello,hello,hola,hallo
Missing entries will be skipped
validation.invalid.chars,not enough cowbell,,Nicht genug Kuhglocke
Options
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
}