Skip to content

Webpack plugin to propagate translations keys into gettext .po files.

License

Notifications You must be signed in to change notification settings

thejoeejoee/webpack-propagate-translation-keys-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webpack propagate translation keys plugin [WIP]

For usage with webpack-extract-translation-keys-plugin:

const path = require('path');
const ExtractTranslationKeysPlugin = require('webpack-extract-translation-keys-plugin');
const ExpandPoFilesPlugin = require('webpack-propagate-translation-keys-plugin');

const translations = path.join(__dirname, 'translation-keys.json');

module.exports = {
    ...,
    plugins: [
        new ExtractTranslationKeysPlugin({
            functionName: '_',
            output: translations
        }),
        new ExpandPoFilesPlugin({
            input: translations,
            localeDir: path.resolve(__dirname, 'locale'), // path to django locale dir
            languages: ['cs'],
            domain: 'webpack'
        })
    ]
};

TODO:

  • correct compiler plugin register
  • parse also VueJs render functions

About

Webpack plugin to propagate translations keys into gettext .po files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published