[英]Angular configuration not set to the workspace
I am facing an issue with localization.我面临本地化问题。 I created a project with two local language support but when I serve the application on my local server I am getting the following error.
我创建了一个具有两种本地语言支持的项目,但是当我在本地服务器上提供应用程序时,出现以下错误。
An unhandled exception occurred: Configuration 'en' is not set in the workspace.
See "C:\Users\AcnTUSR\AppData\Local\Temp\ng-IfhkD8\angular-errors.log" for further details.
My angular.json file looks as follows.我的 angular.json 文件如下所示。
"build": {
"configurations": {
"fr": {
"aot": true,
"i18nFile": "src/translate/messages.fr.xlf",
"i18nFormat": "xlf",
"i18nLocale": "fr",
"i18nMissingTranslation": "error"
},
"en": {
"aot": true,
"i18nFile": "src/translate/messages.en.xlf",
"i18nFormat": "xlf",
"i18nLocale": "en",
"i18nMissingTranslation": "error"
}
},
.....
"serve": {
"configurations": {
"fr": {
"browserTarget": "qwikCollaborator:build:fr"
},
},
"configurations": {
"en": {
"browserTarget": "qwikCollaborator:build:en"
} ,
},
.....
whenever I am hitting the command每当我按下命令时
ng serve --configuration=en
I am getting the following error.我收到以下错误。
An unhandled exception occurred: Configuration 'en' is not set in the workspace.
See "C:\Users\AcnTUSR\AppData\Local\Temp\ng-IfhkD8\angular-errors.log" for further details.
can anyone help me with this?谁能帮我这个? I have both translations files one for english=en language and french=fr language.
我有两个翻译文件,一个用于英语=en 语言和 french=fr 语言。
Thanks in Advance!提前致谢!
You have 2 configurations
nodes for your serve
target, you should only have one您的
serve
目标有 2 个configurations
节点,您应该只有一个
"serve": {
"configurations": {
"fr": { "browserTarget": "qwikCollaborator:build:fr" },
"en": {"browserTarget": "qwikCollaborator:build:en" }
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.