I18N + karibu testing

I am using karibu framework to test my Vaadin 24 UIs/Components. Works well, except that in tests the i18NProvider is not set.
Since I coudln’t find any information in the docs, are there additional steps to configure the i18NProvider for testing? I have annotated the I18NProvider with @Component as per the docs and it works, jusut not while testing.
I am using vaadin 24 with spring boot 3.

Pretty sure I18NProvider must be implemented via Java SPI. Not home but I feel like I have seen a warning message saying that the class cannot be a Spring Bean.

Hi, I managed to fix it or rather I found a workaround: System.setProperty(“vaadin.i18n.provider”,
“packagage.name.I18NProvider”); is enough for Vaadin to be able to provide the I18NProvider.

In my project this works. How do you see that the I18NProvider is not set?

In the getTranslation method of the Vaadin Component class:

     final Optional<I18NProvider> i18NProvider = LocaleUtil
             .getI18NProvider();
     return i18NProvider
             .map(i18n -> i18n.getTranslation(key,
                     LocaleUtil.getLocale(() -> i18NProvider), params))
             .orElseGet(() -> "!{" + key + "}!");
 }```
LocaleUtil .getI18NProvider() returns empty in testing. I managed to get it working in the tests by setting the property System.setProperty("vaadin.i18n.provider", "packagage.name.I18NProvider"). Why it behaved like that I don't know.

Oh I didn’t realize that Karibu is handling I18N

But in my case it returns the annotated I18Nprovider

Checkout GitHub - 72services/jtaf4: JTAF - Java Track and Field maybe you can find a difference to your project