0

I prepared my angular application for localizing. I want to test the different languages before publishing.

{  
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "myProject": {
      "projectType": "application",
      "i18n": {
        "sourceLocale": "en-US",
        "locales": {
          "de-CH": "messages.de-CH.xlf"
        }
      },
...

Csaba mentions here, this can be achieved by using different configurations. But I can't find the configuration-key to apply the local-id. How to serve different Angular locales during development using ng serve?

There's only a "localize" true/false

"development": {
  "buildOptimizer": false,
  "optimization": false,
  "vendorChunk": true,
  "extractLicenses": false,
  "sourceMap": true,
  "namedChunks": true,
  "localize":true
}

Any ideas how testing a different local can be achieved?

Daniel
  • 486
  • 4
  • 19

1 Answers1

0

For deployment ...

As it seems the option localize true/false controls whether ng build will generate localized version of the application in dist-folder.

if true dist will have one subfolder per localization defined in section locales

For development ...

This worke for me...

enter image description here

Daniel
  • 486
  • 4
  • 19