A handful util to generate and merge if exists already locale file for @angular/localize package
npm install angular-locales-generator
npm install angular-locales-generator --save-dev
`
In your package.json file, add the following command:
`json
{
"scripts": {
"locales-generator": "locales-generator --l zh,fr --bp ./src/locale"
}
}
`
- locales: alias as l, the targeting locales, seperated by comma, mandatory
- base-path: alias as bp, the directory where the translation files are stored, mandatory
Run
`
npm run locales-generator
`
or directly without adding scripts in your package.json file
`
npx locales-generator --l zh,fr --bp ./src/locale
``