Where should sourceLocale be set in Angular.json?

Viewed 2999

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?

1 Answers

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.

Related