emit-i18n-json-assets
v0.1.6
Published
CLI to convert i18n .ts/.json files into JSON assets: <out>/<namespace>/<lang>.json (supports centralized & decentralized layouts, with watch mode).
Maintainers
Readme
emit-i18n-json-assets
CLI to generate JSON i18n assets from your Angular source code.
Demo & Tutorial: https://i18n-demo.viacharles.net/
What it does
emit-i18n-json-assets scans your project source and emits JSON translation files
into an assets folder, ready for runtime loading.
Install
npm i -D emit-i18n-json-assetsUsage
emit-i18n-json-assets --src=projects/your-app/src/app --out=projects/your-app/src/assets/i18nOptions
--src(required) Source root to scan (usuallysrc/app)--out(required) Output directory for generated JSON files
Example script
{
"scripts": {
"i18n:emit": "emit-i18n-json-assets --src=projects/ngx-i18n-demo/src/app --out=projects/ngx-i18n-demo/src/assets/i18n"
}
}Notes
- Run this before
ng buildso the assets are available for CSR/SSR/SSG. - The output structure mirrors your i18n namespaces in code.

