sourceLocale 应该在 Angular.json 中的哪里设置?

888*_*888 21 localization internationalization angular

i18n Angular 文档指定您需要通过更改sourceLocale项目Angular.json文件中的字段来设置语言 ID 和区域设置扩展,但该字段在新项目中不存在。这个字段应该在json中定义在哪里?

888*_*888 29

{language_id}-{locale_extension}应以 的形式指定语言 ID 和区域设置扩展的字符串,projects.{projectName}.i18n.sourceLocale如下所示:

"projects": {
  "my-angular-project": {
    "i18n": {
      "sourceLocale": "en-US"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

在此示例中,我们使用英语 US ( "en-US") 作为 Unicode 区域设置 ID。