0.0.7 • Published 7 years ago

localization-webpack-plugin v0.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

LocalizationWebpackPlugin

Make separate JSON localization files for every chunk

Usage

This plugin creates merged JSON files with translations for cunks. One JSON file by one chunk. To get link to JSON file with translations you need to write in code

// 'chunkLocalizationURL: {"chunkName": "warAndPeace", "lang": "en"}' will be replaced by 'warAndPeace.en.json'
const linksToTranslationFiles = {
  warAndPeaceEN: 'chunkLocalizationURL: {"chunkName": "warAndPeace", "lang": "en"}',
  warAndPeaceRU: 'chunkLocalizationURL: {"chunkName": "warAndPeace", "lang": "ru"}'
};

Options

plugins: [
  ...
  new LocalizationWebpackPlugin({
    filename: '[chunkname].[lang].json', // Avaible: [chunkname], [hash], [lang]
    locales: ['en', 'ru'],
  }),
],
  • filename: the default value is [chunkname].[lang].json Avaible tags is [chunkname], [hash], [lang]
  • locales: the default value is ['en']
0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago