interpolateMessageCallback is never executed

Plz any idea why this does not work?

Java model
@NotBlank
@Size(max = 250)
@Pattern(regexp = “^(\+([0-9]{1,3})(-)([0-9]{9,11}))$”, message=“customValidationError.field.phoneNumber”)
private String phoneNumber;

TS model
get phoneNumber(): StringModel_1 {
return this[_getPropertyModel_1](“phoneNumber”, StringModel_1, [true, new NotBlank_1(), new Size_1({ max: 250 }), new Pattern_1({ regexp: “^(\+([0-9]{1,3})(-)([0-9]{9,11}))$”, message: “customValidationError.field.phoneNumber” })]) as StringModel_1;
}

Localization (i18n works fine in other parts of the app)
import { get, registerTranslateConfig, use } from ‘lit-translate’;
import {Binder} from “@hilla/form”;

Binder.interpolateMessageCallback = … (code from hilla sample, it is never executed)

Form
<vaadin-text-field
label=“${get(‘contactForm.phoneNumber.label’)}”
helper-text=“${get(‘contactForm.phoneNumber.helperText’)}”
${field(this.binder.model.phoneNumber)}
@change=${this.onChange}>

Displayed validation message
“customValidationError.field.phoneNumber”

Can you compare your project to this demo hilla-demo/frontend/index.ts at master · TatuLund/hilla-demo · GitHub

There it is working. I am using it to get localized texts for the error messages in that particular demo.

I ll have a look at it thanks

Still no idea but it works when setting BinderRoot.interpolateMessageCallback directly instead of Binder.interpolateMessageCallback =

But,
let key = validationError.${validator.constructor.name};
returns obfuscated classes and constructs key “validationError.E” instead of “validationError.AssertTrue”

Maybe that is also the case with Binder, that there are two instances of the class, one normal, one obfuscated and becasue of that the interpolateMessageCallback does not work?

Maybe some build misconfiguration?

(It is Hilla 2.2.2)

(upgraded from 1.x)