Install
npm i -D i18n-webpack-plugin
Usage
see webpack/webpack/examples/i18n.
Options
plugins: [
...
new I18nPlugin(languageConfig, optionsObj)
],
optionsObj.functionName
: the default value is__
, you can change it to other function name.optionsObj.failOnMissing
: the default value isfalse
, which will show a warning message, if the mapping text cannot be found. If set totrue
, the message will be an error message.optionsObj.hideMessage
: the default value isfalse
, which will show the warning/error message. If set totrue
, the message will be hide.optionsObj.keyset
: the default value isfalse
. Turns on the support of the nested dictionaries. Possible values: boolean, string or a custom function. String value adds the default keyset value and supports[name]
and[ext]
aliases. Example:__('keyset', 'key')
will look for{keyset: {key: 'any value'}}
in the localization object.optionsObj.pluralIdentName
: chooses the identifier name to be used for the plural keys. Default:count
.optionsObj.pluralRule
: chooses the rule for the dynamic keys. Supportsstring
aliases. Default:0
.
Development
npm run test
will run testsnpm run autotest
will watchlib
,test
andindex.js
for changes and retest
Maintainers
Juho Vepsäläinen |
Joshua Wiens |
Kees Kluskens |
Sean Larkin |