FormBuilder中的角式设置语言

问题描述 投票:0回答:1

我找不到用于更改FormBuilder语言的解决方案。对于渲染器,它由文档进行了描述,但不适用于Builder。

在Builder中,它必须由选项设置,但是FormioOptions不包括language选项。是否有使用说明或示例?

HTML代码

<div class="content" role="main">
  <form-builder [form]="form" (change)="onChange($event)" [options]="formOptions"></form-builder>
  <button (click)="onClick()">Formular speichern (Ausgabe auf Konsole)</button>
</div>

TypeScript代码

import { Component, ViewChild, ElementRef, EventEmitter } from '@angular/core';
import { FormIOModel } from 'src/models/formIOModel';
import { FormioOptions } from 'angular-formio';

@Component({
  selector: 'app-generator',
  templateUrl: './generator.component.html',
  styleUrls: ['./generator.component.scss']
})
export class GeneratorComponent {

  @ViewChild('json') jsonElement?: ElementRef;
  public form: FormIOModel = new FormIOModel();
  private result: FormIOModel = new FormIOModel();
  public formOptions: FormioOptions = {
    language: 'de', // that's the unknown line
    i18n: {
      de: {
        'Preview': 'Vorschau'
      }
    }
  }

  onChange(event) {
    this.result = event.form;
  }
}

没有语言,它什么也不做。在app.module.ts或其他地方还有其他事情要做或配置吗?

谢谢

angular translation builder formio language
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.