小编ura*_*idi的帖子

发生未处理的异常:开发服务器仅支持每个构建本地化单个区域设置

请告知如何修复此错误,我正在尝试实现本地化,但遇到了此问题。我使用的指南: https: //angular.io/guide/i18n#merge-translations-into-the-app 如果有帮助,我可以使用 ngserve --configuration=ru --open 运行并且应用程序已本地化,但是在我使用 _build.bat 之后,它破坏了我的应用程序,我根本无法再运行它。如果我指定不同的端口,则会抛出错误“NGCC 失败”。这是我的 angular.json 文件中的代码示例:

"projects": {
"operator": {
   "i18n": {
        "sourceLocale": "en-US",
        "locales": {
          "ru": "src/locale/messages.ru.xlf"
        }
   },
  "projectType": "application",
  "schematics": {},
  "root": "",
  "sourceRoot": "src",
  "prefix": "app",
  "architect": {
    "build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
        "outputPath": "dist/operator",
        "index": "src/index.html",
        "main": "src/main.ts",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "tsconfig.app.json",
        "aot": true,
        "localize": true,
        "assets": [
          "src/favicon.ico",
          "src/assets"
        ],
        "styles": [
          "src/styles.css"
        ],
        "scripts": ["src/version.js"]
      },
      "configurations": {
        "ru": {
            "localize": ["ru"]
        },
        "production": { …
Run Code Online (Sandbox Code Playgroud)

angular

8
推荐指数
3
解决办法
7584
查看次数

标签 统计

angular ×1