Closed mcentrih closed 1 year ago
Hello. If you don't need to support multiple languages, you can set up a custom i18n instance globally by replacing the default ErrorWindowFactory. In order to do so, set up a VaadinServiceInitListener as follows:
@Component
public class ErrorWindowServiceInitListener
implements VaadinServiceInitListener {
@Override
public void serviceInit(ServiceInitEvent event) {
ErrorWindowI18n i18n = new ErrorWindowI18n();
i18n.setCaption(...);
i18n.setCaption(...);
ErrorManager.setErrorWindowFactory(Throwable.class, details -> new ErrorWindow(details, i18n).open());
}
}
Please let us know if that helped.
While my comment above allows customizing the texts globally, it does not allow to resolve them based on the locale of the current UI, which is a desirable feature.
It would be very good if you would allow to set custom I18n text for whole dialog globaly. So that we would not need to set text in every error case each.