3

As written in the doc, I have installed tooling from @ngx-i18nsupport: enter image description here

setup everything and in may package.json file the following script:

"extract-i18n": "ng xi18n IOCheck --i18n-format xlf 
--output-path i18n --i18n-locale fr && xliffmerge"

when running the script I receive the folowing error message:

An unhandled exception occurred: No projects support the 'extract-i18n' target.
See "/private/var/folders/3v/77qlrbxn15174h43y9qs7v8w0000gn/T/ng-TFnOne/angular-errors.log" for further details.

So I checked angular.json and the file seems ok:

angular.json

xliffmerge works fine from the command line... Any help would be greatly appreciated.

Thanks

Philippe Corrèges
  • 663
  • 1
  • 11
  • 31

1 Answers1

5

its work for translation for based on this way

You will now find 3 files under src/i18n

1)messages.xlf: The master file containing all the messages found in your app.

2)messages.de.xlf: The German version.

3)messages.en.xlf: The (up to now untranslated) English version.

Package: package.json

{
  [...]
  "scripts": {
    [...]
    "extract-i18n": ...,
    "start-en": "ng serve --configuration=en"
  }
  [...]
}

angular: angular.json

.."build": {
    "configurations": {
..
            "en": {
              "aot": true,
              "outputPath": "dist/sampleapp-en",
              "i18nFile": "src/i18n/messages.en.xlf",
              "i18nFormat": "xlf",
              "i18nLocale": "en"
            }
.."serve": {
..
          "configurations": {
..
            "en": {
              "browserTarget": "sampleapp:build:en"
            }

Run

npm run start-en

For more information check this link xliffmerge

Community
  • 1
  • 1
Savaj Patel
  • 525
  • 2
  • 16