@atlassian/i18n-properties-loader
A Webpack loader for i18n *.properties
files that can be used in Atlassian Server products
Install
npm install @atlassian/i18n-properties-loader --save-dev
Usage
const i18nFiles = [
'foo/i18n/my-translation-file.properties',
'foo/bar/i18n/my-other-translation-file.properties',
'bar/i18n/some-translation-file.properties',
];
module.exports = {
module: {
rules: [
{
test: /\.jsx?$/,
include: ["src"],
use: [
{
loader: '@atlassian/i18n-properties-loader',
options: {
i18nFiles
},
},
{
loader: 'babel-loader'
}
]
}
]
}
}
Options
i18nFiles
list of paths to your *.properties
files (required)disabled
disables the loader; can we used to disabled in production bundle (optional, default false
)
This package plays nice with the @atlassian/wrm-react-i18n
when you want to bundle your code for production.
You check the package description and learn how to integrate it with your webpack configuration.
Links