i18next-webpack-locale-sync
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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
}

Package Sidebar

Install

npm i i18next-webpack-locale-sync

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

263 kB

Total Files

20

Last publish

Collaborators

  • sjsanc