-
Notifications
You must be signed in to change notification settings - Fork 74
fix: add locale fallback for MessageList to handle variants #8417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MessageList now gracefully handles locale variants (e.g., "de-DE-hw") by implementing a progressive fallback strategy when the full locale string is not valid for Intl.DateTimeFormat: 1. Try full locale (e.g., "de-DE-hw") 2. Fall back to base locale (e.g., "de-DE") 3. Fall back to language only (e.g., "de") 4. Fall back to browser default This prevents the component from crashing when custom locale variants are used for resource bundle customization.
035e9e5 to
bb84139
Compare
DiegoCardoso
reviewed
Jan 5, 2026
...ntegration-tests/src/main/java/com/vaadin/flow/component/messages/tests/MessageListPage.java
Outdated
Show resolved
Hide resolved
.../vaadin-messages-flow/src/main/resources/META-INF/resources/frontend/messageListConnector.js
Outdated
Show resolved
Hide resolved
DiegoCardoso
reviewed
Jan 5, 2026
...-integration-tests/src/test/java/com/vaadin/flow/component/messages/tests/MessageListIT.java
Outdated
Show resolved
Hide resolved
…ests/src/test/java/com/vaadin/flow/component/messages/tests/MessageListIT.java Co-authored-by: Diego Cardoso <diego@vaadin.com>
…ests/src/main/java/com/vaadin/flow/component/messages/tests/MessageListPage.java Co-authored-by: Diego Cardoso <diego@vaadin.com>
Store the result of locale.split('-') in a variable to avoid calling
it twice when building the fallback locale array.
DiegoCardoso
approved these changes
Jan 7, 2026
|
vaadin-bot
pushed a commit
that referenced
this pull request
Jan 7, 2026
* fix: add locale fallback for MessageList to handle variants (#8403) MessageList now gracefully handles locale variants (e.g., "de-DE-hw") by implementing a progressive fallback strategy when the full locale string is not valid for Intl.DateTimeFormat: 1. Try full locale (e.g., "de-DE-hw") 2. Fall back to base locale (e.g., "de-DE") 3. Fall back to language only (e.g., "de") 4. Fall back to browser default This prevents the component from crashing when custom locale variants are used for resource bundle customization. * Update vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/src/test/java/com/vaadin/flow/component/messages/tests/MessageListIT.java Co-authored-by: Diego Cardoso <diego@vaadin.com> * Update vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/src/main/java/com/vaadin/flow/component/messages/tests/MessageListPage.java Co-authored-by: Diego Cardoso <diego@vaadin.com> * refactor: avoid duplicate split operation in locale fallback Store the result of locale.split('-') in a variable to avoid calling it twice when building the fallback locale array. --------- Co-authored-by: Diego Cardoso <diego@vaadin.com>
vaadin-bot
pushed a commit
that referenced
this pull request
Jan 7, 2026
* fix: add locale fallback for MessageList to handle variants (#8403) MessageList now gracefully handles locale variants (e.g., "de-DE-hw") by implementing a progressive fallback strategy when the full locale string is not valid for Intl.DateTimeFormat: 1. Try full locale (e.g., "de-DE-hw") 2. Fall back to base locale (e.g., "de-DE") 3. Fall back to language only (e.g., "de") 4. Fall back to browser default This prevents the component from crashing when custom locale variants are used for resource bundle customization. * Update vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/src/test/java/com/vaadin/flow/component/messages/tests/MessageListIT.java Co-authored-by: Diego Cardoso <diego@vaadin.com> * Update vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/src/main/java/com/vaadin/flow/component/messages/tests/MessageListPage.java Co-authored-by: Diego Cardoso <diego@vaadin.com> * refactor: avoid duplicate split operation in locale fallback Store the result of locale.split('-') in a variable to avoid calling it twice when building the fallback locale array. --------- Co-authored-by: Diego Cardoso <diego@vaadin.com>
DiegoCardoso
added a commit
that referenced
this pull request
Jan 7, 2026
…8420) * fix: add locale fallback for MessageList to handle variants (#8403) MessageList now gracefully handles locale variants (e.g., "de-DE-hw") by implementing a progressive fallback strategy when the full locale string is not valid for Intl.DateTimeFormat: 1. Try full locale (e.g., "de-DE-hw") 2. Fall back to base locale (e.g., "de-DE") 3. Fall back to language only (e.g., "de") 4. Fall back to browser default This prevents the component from crashing when custom locale variants are used for resource bundle customization. * Update vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/src/test/java/com/vaadin/flow/component/messages/tests/MessageListIT.java * Update vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/src/main/java/com/vaadin/flow/component/messages/tests/MessageListPage.java * refactor: avoid duplicate split operation in locale fallback Store the result of locale.split('-') in a variable to avoid calling it twice when building the fallback locale array. --------- Co-authored-by: Artur Signell <artur@vaadin.com> Co-authored-by: Diego Cardoso <diego@vaadin.com>
DiegoCardoso
added a commit
that referenced
this pull request
Jan 7, 2026
…CP: 24.9) (#8421) * fix: add locale fallback for MessageList to handle variants (#8417) * fix: add locale fallback for MessageList to handle variants (#8403) MessageList now gracefully handles locale variants (e.g., "de-DE-hw") by implementing a progressive fallback strategy when the full locale string is not valid for Intl.DateTimeFormat: 1. Try full locale (e.g., "de-DE-hw") 2. Fall back to base locale (e.g., "de-DE") 3. Fall back to language only (e.g., "de") 4. Fall back to browser default This prevents the component from crashing when custom locale variants are used for resource bundle customization. * Update vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/src/test/java/com/vaadin/flow/component/messages/tests/MessageListIT.java Co-authored-by: Diego Cardoso <diego@vaadin.com> * Update vaadin-messages-flow-parent/vaadin-messages-flow-integration-tests/src/main/java/com/vaadin/flow/component/messages/tests/MessageListPage.java Co-authored-by: Diego Cardoso <diego@vaadin.com> * refactor: avoid duplicate split operation in locale fallback Store the result of locale.split('-') in a variable to avoid calling it twice when building the fallback locale array. --------- Co-authored-by: Diego Cardoso <diego@vaadin.com> * refactor: remove use of API not available in Java 17 --------- Co-authored-by: Artur Signell <artur@vaadin.com> Co-authored-by: Diego Cardoso <diego@vaadin.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



MessageList now gracefully handles locale variants (e.g., "de-DE-hw") by implementing a progressive fallback strategy when the full locale string is not valid for Intl.DateTimeFormat:
This prevents the component from crashing when custom locale variants are used for resource bundle customization.
Fixes #8403