Search code examples
nativescriptnativescript-angular

Translate validation message in RadDataForm - Nativescript/Angular


I have this configs for a RadDataForm.

{
    isReadOnly: false,
    commitMode: "Immediate",
    validationMode: "Immediate",
    propertyAnnotations: [
      {
        name: "name",
        displayName: "name",
        index: 0,
        validators: [{name: "NonEmptyValidator"}],
      }
    ]
}

And work fine. But, can I translate the validator message Entered value cannot be empty?

I been search inside the docs but, I can't found nothing about this topic.


Solution

  • You can pass the errorMessage for each validator, ensure you are passing the right translation.

    I presume you must be using nativescript-i18n Or some other plugins to keep track of translations in your app, just fetch the right string and pass it to validator.