https://github.com/ocombe/i18n-demo-no-cli
Angular i18n demo with webpack
https://github.com/ocombe/i18n-demo-no-cli
Last synced: 9 months ago
JSON representation
Angular i18n demo with webpack
- Host: GitHub
- URL: https://github.com/ocombe/i18n-demo-no-cli
- Owner: ocombe
- Created: 2017-10-16T22:09:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-02T07:55:08.000Z (over 8 years ago)
- Last Synced: 2025-09-03T15:49:30.376Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 92.8 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Angular i18n demo with webpack
- Webpack and @ngtool packages, but no @angular/cli.
- Supports both JIT and AOT.
### How to use:
Update the file `env.conf.json` by setting:
- `defaultLang`: the lang of the application without translations
- `i18nInFormat`: the format of the translations file for serve/build
- `i18nOutFormat`: the format of the translations file for extraction
- `outFile`: the name of the file for extraction
- `outputPath`: the path where the translations file should be extracted, relative to the src folder
Use the commands from package.json to serve/build the app: `npm run start` & `npm run start:fr` will use JIT, `npm run start:aot` and `npm run start:aot:fr` will use AOT.
Same thing for the build commands.
Extract the messages with the command `npm run extract`,
it will extract the messages to the src/i18n/ folder (unless you change the `env.conf.json` file)
and it will automatically merge the new messages into your existing translations using the [ngx-i18nsupport library](https://github.com/martinroob/ngx-i18nsupport).
Right now it supports the language fr, you can add more languages for the merge option in the file xliffmerge.conf.json (see the [ngx-i18nsupport repository](https://github.com/martinroob/ngx-i18nsupport) for more info).
/!\ the extraction requires to build your app with AOT, if your app doesn't support AOT, you won't be able to extract.