Where should sourceLocale be set in Angular.json?
Asked Answered
A

1

22

The i18n Angular docs specify that you need to set the language id and locale extension by changing the sourceLocale field in your project's Angular.json file, but this field does not exist in a new project. Where should this field be defined in the json?

Alienee answered 30/10, 2021 at 12:37 Comment(0)
A
32

The string of the language id and locale extension in the form of {language_id}-{locale_extension} should be specified at projects.{projectName}.i18n.sourceLocale as seen below:

"projects": {
  "my-angular-project": {
    "i18n": {
      "sourceLocale": "en-US"
    }
  }
}

In this example we are using English US ("en-US") as the Unicode Locale ID.

Alienee answered 30/10, 2021 at 12:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.