hilla
hilla copied to clipboard
[i18n] Support unit testing with actual translations
When running unit tests, for example with Vitest, it should be possible initialize the I18n instance with actual translation messages so that developers can properly test whether translations work as expected.
The current approach is that the I18n instance loads translation messages from the backend at runtime. When running unit tests, the backend would not be available, and thus it would not be possible to load translations from it.
In order to support testing translations from unit tests it would need to be possible to use actual translation messages as defined in the property files in the Java application.
As an alternative, developers could write E2E tests to verify that translations work properly.