翻译不起作用(jhipster)

时间:2018-03-17 22:24:12

标签: html angular jhipster

我刚刚开始使用Web开发,我正在使用jHipster来开始。我目前正在构建一个包含表单的新页面,该表单稍后会保存数据。

我目前仍然坚持使用表单标签。不知何故,翻译搞砸了。如果我使用jhiTranslate,表单标签将完全消失。如果我删除翻译调用,它会很好地显示。

这是我到目前为止所做的:

  • 我检查了翻译json文件,所有密钥都存在。
  • 我检查了其他页面的参考资料,我无法区分
  • 所有代码正确关闭
  • 模型已在相应的打样文件中正确导入。

这是失败表单的html代码:

<div>
<div class="row justify-content-center">
    <div class="col-md-8">
        <h2 jhiTranslate="swingkassoApp.case-manager.new-case.title">Create new Case</h2>
        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #collectionCaseNewForm="ngForm">

            <div>
                <jhi-alert-error></jhi-alert-error>
            </div>

            <div class="form-group">
                <label for="id" jhiTranslate="global.field.id">ID</label>
                <input type="text" class="form-control" id="id" name="id" [(ngModel)]="collectionCase.id" readonly />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.case-manager.case-number" for="field_caseNumber">Case Number</label>
                <input type="text" class="form-control" name="caseNumber" id="caseNumber" [(ngModel)]="collectionCase.caseNumber" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.reason" for="field_reason">Reason</label>
                <input type="text" class="form-control" name="reason" id="field_reason" [(ngModel)]="collectionCase.reason" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.remark" for="field_remark">Remark</label>
                <input type="text" class="form-control" name="remark" id="field_remark" [(ngModel)]="collectionCase.remark" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.state" for="field_state">State</label>
                <input type="number" class="form-control" name="state" id="field_state" [(ngModel)]="collectionCase.state" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.currency" for="field_currency">Currency</label>
                <input type="number" class="form-control" name="currency" id="field_currency" [(ngModel)]="collectionCase.currency" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.baseAmount" for="field_baseAmount">Base Amount</label>
                <input type="number" class="form-control" name="baseAmount" id="field_baseAmount" [(ngModel)]="collectionCase.baseAmount" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.interestRate" for="field_interestRate">Interest Rate</label>
                <input type="number" class="form-control" name="interestRate" id="field_interestRate" [(ngModel)]="collectionCase.interestRate" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.interest" for="field_interest">Interest</label>
                <input type="number" class="form-control" name="interest" id="field_interest" [(ngModel)]="collectionCase.interest" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.collectionCost" for="field_collectionCost">Collection Cost</label>
                <input type="number" class="form-control" name="collectionCost" id="field_collectionCost" [(ngModel)]="collectionCase.collectionCost" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.enforcementCost" for="field_enforcementCost">Enforcement Cost</label>
                <input type="number" class="form-control" name="enforcementCost" id="field_enforcementCost" [(ngModel)]="collectionCase.enforcementCost" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.informationCost" for="field_informationCost">Information Cost</label>
                <input type="number" class="form-control" name="informationCost" id="field_informationCost" [(ngModel)]="collectionCase.informationCost" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.customCost1Name" for="field_customCost1Name">Custom Cost 1 Name</label>
                <input type="text" class="form-control" name="customCost1Name" id="field_customCost1Name" [(ngModel)]="collectionCase.customCost1Name" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.customCost1Amount" for="field_customCost1Amount">Custom Cost 1 Amount</label>
                <input type="number" class="form-control" name="customCost1Amount" id="field_customCost1Amount" [(ngModel)]="collectionCase.customCost1Amount" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.customCost2Name" for="field_customCost2Name">Custom Cost 2 Name</label>
                <input type="text" class="form-control" name="customCost2Name" id="field_customCost2Name" [(ngModel)]="collectionCase.customCost2Name" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.customCost2Amount" for="field_customCost2Amount">Custom Cost 2 Amount</label>
                <input type="number" class="form-control" name="customCost2Amount" id="field_customCost2Amount" [(ngModel)]="collectionCase.customCost2Amount" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.totalAmount" for="field_totalAmount">Total Amount</label>
                <input type="number" class="form-control" name="totalAmount" id="field_totalAmount" [(ngModel)]="collectionCase.totalAmount" />
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.grandTotalAmount" for="field_grandTotalAmount">Grand Total Amount</label>
                <input type="number" class="form-control" name="grandTotalAmount" id="field_grandTotalAmount" [(ngModel)]="collectionCase.grandTotalAmount" />
            </div>

            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.creditor" for="field_creditor">Creditor</label> <select class="form-control" id="field_creditor" name="creditor" [(ngModel)]="collectionCase.creditorId">
                    <option [ngValue]="null"></option>
                    <option [ngValue]="creditorOption.id" *ngFor="let creditorOption of creditors; trackBy: trackCreditorById">{{creditorOption.id}}</option>
                </select>
            </div>
            <div class="form-group">
                <label class="form-control-label" jhiTranslate="swingkassoApp.collectionCase.debitor" for="field_debitor">Debitor</label> <select class="form-control" id="field_debitor" name="debitor" [(ngModel)]="collectionCase.debitorId">
                    <option [ngValue]="null"></option>
                    <option [ngValue]="debitorOption.id" *ngFor="let debitorOption of debitors; trackBy: trackDebitorById">{{debitorOption.id}}</option>
                </select>
            </div>
            <div>
                <button type="submit" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
                    <span class="fa fa-save"></span>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
                </button>
            </div>
        </form>
    </div>
</div>

任何指针都表示赞赏。由于我只运行了一个本地实例,因此SSCCE很难提供,但我很乐意在需要时提供其他信息。谢谢!

0 个答案:

没有答案