Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the messages.xlf output location when running Angular i18n?

I'm using angular's i18n tools and have moved the messages.xlf output to a different folder than the default location (a new directory: \app\locale), as suggested.

When I rerun

>npm run i18n

even in the newly added app/locale directory, the messages.xlf file is output to the default location.

How can I specify where the output messages.xlf file is output to prevent having to move it around each time I regenerate it?

like image 228
StuperUser Avatar asked Dec 15 '25 18:12

StuperUser


1 Answers

You can add a new option to your tsconfig.json to tell the angular compiler where to output the file.

{
  "compilerOptions": {
    //your normal options...
  },
  "angularCompilerOptions": {
    "genDir": "./app/locale"
  }
}

When you execute the i18n program make sure to include the tsconfig.json location.

node_modules\.bin>ng-xi18n -p ../../src/tsconfig.json
like image 123
Rose Nettoyeur Avatar answered Dec 18 '25 12:12

Rose Nettoyeur



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!