Repository navigation
fix: send well-formed locale tag to time picker connector (#10244) (CP: 25.2) - #10255
Merged
Merged
Conversation
## Description Fixes #3309 Follow-up to #9873 `TimePicker` built the locale tag by joining `getLanguage()` and `getCountry()` as they are. An ill-formed locale, such as `new Locale("en_GB")`, produced a tag like `en_gb`. The browser rejects it, so the connector threw `The locale en_gb is not supported` and never set up locale-based formatting. #9873 fixed only the text of that error. - Changed `TimePicker` to parse the tag with `Locale.forLanguageTag` and send only its language and region to the connector - Well-formed locales produce the same tag as before, and script and variant are still dropped - A tag used as the language keeps its region, e.g. `new Locale("en-CA")` sends `en-CA` - Ill-formed subtags are dropped, e.g. `new Locale("en_GB")` sends `und`, so the browser falls back to its default locale - Corrected the `setLocale` Javadoc, which promised an `en-US` fallback that never happened - Added unit tests in `TimePickerLocaleTest` for the tag sent to the connector, including a tag used as the language and an ill-formed language and country - Changed the browser-formatted time helper in `TimePickerLocalizationView` to build a well-formed tag, so it does not throw its own error for an ill-formed locale ## Type of change - Bugfix ## How to test 1. Open `TimePickerLocalizationView.java` at `/vaadin-time-picker/time-picker-localization/en_GB-XX-10-30` 2. Check the browser console and the dev-mode error dialog 3. There is no `vaadin-time-picker: The locale ... is not supported` error, and the time picker shows `10:30` in the format of the browser default locale 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
web-padawan
approved these changes
Sep 28, 2026
web-padawan
enabled auto-merge (squash)
September 28, 2026 07:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Collaborator
Author
|
This ticket/PR has been released with Vaadin 25.2.10. |
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
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.



This PR cherry-picks changes from the original PR #10244 to branch 25.2.
Original PR description