vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
603 stars 165 forks source link

Client-side English error messages despite setting the SystemMessages through a SystemMessages provider #19677

Open enver-haase opened 2 months ago

enver-haase commented 2 months ago

Description of the bug

Screenshot 2024-07-05 at 11 36 31

These messages appeared in an opened browser tab when the server was restarted.

Expected behavior

When the application is configured to redirect to the home page when the session was lost, then it should just do that. All the messages were translated, but still an English message was shown.

Minimal reproducible example

public MySystemMessages() { boolean showNotification = SystemInfo.getShowSystemNotifications(); setInternalErrorNotificationEnabled(showNotification); setSessionExpiredNotificationEnabled(showNotification); setCookiesDisabledNotificationEnabled(showNotification); setInternalErrorURL(URL); setSessionExpiredURL(URL); setCookiesDisabledURL(URL); }

Set those, run the application, kill the application server.

Versions

enver-haase commented 2 months ago

ah, sorry, please merge with #19224

mcollovati commented 2 months ago

@enver-haase could you elaborate a bit on what the exact problem is? Is it the application not being redirected to the home page on session expiration? Or about the English text in the attached screenshot?

enver-haase commented 2 months ago

Well, I think you spotted exactly what happened. What the exact problem is, is defined by the Vaadin documentation and the settings I provided above. In my understanding, the session has expired and the client-side JavaScript application should have redirected to some URL. But the documentation does not say about any precedence/priority IIRC. The session-exipred notification that was shown - it was not in German (which was intended) either though.

dex-ds commented 2 months ago

Maybe an inspiration. Create your own SystemMessagesProvider (as Singleton) do something like this. image

Create an ServiceInitListener and set this thing... image

Be happy ;-)