Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where should sourceLocale be set in Angular.json?

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?

like image 213
8888 Avatar asked Sep 08 '25 08:09

8888


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.

like image 61
8888 Avatar answered Sep 10 '25 07:09

8888