我正在使用generator-jhipster来开发应用程序。但是i18n不会显示
错误:translation-not-found [error.title]
打击是我的代码:
.yo-rc.json
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.myApp.app"
},
"jhipsterVersion": "4.5.1",
"baseName": "myapp",
"packageName": "com.myapp.app",
"packageFolder": "com/myapp/app",
.......,
"clientFramework": "angularX",
"useSass": true,
"clientPackageManager": "yarn",
"applicationType": "gateway",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"skipServer": true,
"languages": [
"en"
]
}
}
error.component.html
<div class="row">
<div class="col-md-12">
<h1 jhiTranslate="error.title">Error Page!</h1>
<div [hidden]="!errorMessage">
<div class="alert alert-danger">{{errorMessage}}
</div>
</div>
<div [hidden]="!error403" class="alert alert-danger" jhiTranslate="error.403">You are not authorized to access the page.
</div>
</div>
</div>
error.json文件包含以下位置:src =&gt; main =&gt; webapp =&gt; i18n =&gt; en =&gt; error.json
error.json
{
"error": {
"title": "Error page!",
"403": "You are not authorized to access the page."
}
}