I have Angular 6 app build by Angular CLI. Application is written in multiple languages. Each language has JSON file with translations of all the applicat
As part of the CLI 6.1 release, a feature was added that allows files to be replaced during the build other than .ts
files. Previously this was used for the environment
and environment.prod
files
Additional files can now be set with the fileReplacements
key of the angular.json
configurations
. As far as I know, it should work with asset files, so .json
should work. It's only been added recently, but there are issues/feature details that you can look up
Let us know if it works out!
P.S. If you don't want to complicate the angular.json
configuration, you could create a .js
node script, and run it before doing the build, passing in the language as a param, and replacing the relevant .json
file in before building the Angular bundles