Overriding default error messages using internationalization (Anglular)

Hi All,
I’m trying to override the default error messages using the i18n object. However, when trying to bind to my i18n object i get the error: Can’t bind to ‘i18n’ since it isn’t a known property of ‘jsonforms’ Here is my json forms root component:

 <jsonforms
 #form
 [schema]="schema"
 [renderers]="renderers"
 [ajv] ="ajv"
 [locale]="'en-US'"
 [(data)]="formData"
 [validationMode] ="validationMode"
 (dataChange)="onChange($event)"
 (errors)="onErrors($event)"
 [i18n] = "i18nObj" >
 </jsonforms>

Here is my i18nObj that I’m trying to bind to the i18n prop:

 i18nObj = {
    translate:
    (key: string, defaultMessage: string | undefined) => {
      if(key === "error.required"){
        return "This field is required."
      }
      return defaultMessage;
    }
  }

I see in the documentation that the i18n has the @Input decorator:

export class JsonForms implements OnChanges, OnInit {

    @Input() uischema: UISchemaElement;
    @Input() schema: JsonSchema;
    @Input() data: any;
    @Input() renderers: JsonFormsRendererRegistryEntry[];
    @Input() uischemas: { tester: UISchemaTester; uischema: UISchemaElement; }[];
    @Output() dataChange = new EventEmitter<any>();
    @Input() readonly: boolean;
    @Input() validationMode: ValidationMode;
    @Input() ajv: Ajv;
    @Input() config: any;
    @Input() i18n: JsonFormsI18nState;
    @Input() additionalErrors: ErrorObject[];
    @Output() errors = new EventEmitter<ErrorObject[]>();

Here is my package.json:
@jsonforms/angular”: “3.0.0-alpha.1”,
@jsonforms/angular-material”: “^3.0.0-alpha.1”,
@jsonforms/core”: “^3.0.0-alpha.1”,
@jsonforms/material-renderers”: “^3.0.0-alpha.1”,

Any idea what’s happening here? Am i approaching this in the wrong way? Any guidance would be greatly appreciated. Thanks

Hi @Jayrack813,

the i18n support is available since 3.0.0-alpha.2 so you need to upgrade the JSON Forms dependencies. I would like to recommend to update to the latest 3.0.0-beta.5.

Ah okay, I’ve just tried updating to ^3.0.0-beta.5, but it seems for that version you need angular version 12 or 13: @angular/core@“^12.0.0 || ^13.0.0” from @jsonforms/angular@3.0.0-beta.5…Im running:
@angular/common”: “^11.2.14”,
@angular/compiler”: “^11.2.14”,
@angular/core”: “^11.2.14”,
So is it not possible to use 3.0.0-beta.5 with angular 11?

They were built against Angular 12 and were also tested against Angular 13. I don’t know whether they work with Angular 11. I fear they do not.

Ok, Thanks for your helo Stefan!