-
Notifications
You must be signed in to change notification settings - Fork 63
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
Use Locale for determinating I18N values #1382
Comments
it would be nice to override this only once and every date picker in UI will have new I18N object, instead of setting I18N object for every instance of date picker |
Just want the mention that the picker popup need to display also the correct year in case the locale is changing the year due to Transformation from gregorian calender to buddhist for example. |
Related issue in the web component (let's keep both open for now): vaadin/web-components#3383 |
Just like the date pattern, the four properties mentioned in this issue can be determined automatically based on the locale (with information already provided by Java), which would help a lot and only leaves a few labels to be translated. The following code determines the four properties based on
|
@Frettman Your code is awesome 😍 I changed it slightly, so that it also works with weird languages, like the one we speak here in Finland. Then integrated into VDatePicker and VDateTimePicker in Viritin. They now read proper settings from active locale 😎: Available in in.virit:viritin:1.3.0 as soon as Maven central gets synchronised. |
@mstahv Glad it was useful :) There's one thing I should add though: |
Yup, complete locale is needed indeed. I have no idea how common it is to use locales without country and if that is on purpose or not. Depending on that, it might be that the additional logic you described would make sense. |
After vaadin/vaadin-date-picker-flow#38, the component will have locale support for displaying the selected date value, but it is not applied to the date picker popup, which is localized via the properties in the
DatePickerI18N
object.The set locale should be used for figuring out the following properties for the
DatePickerI18N
object:Acceptance Criteria
The text was updated successfully, but these errors were encountered: