vaadin / flow-components

Java counterpart of Vaadin Web Components
100 stars 66 forks source link

feat: expose i18n object by adding setter and getter #6330

Closed vursen closed 2 months ago

vursen commented 4 months ago

Description

The PR provides public access to the i18n object of DateTimePicker by adding setter and getter methods.

[!NOTE] The i18n object has only two properties at the moment: dateLabel and timeLabel. These properties specify a suffix to be added to the aria-label of DatePicker and TimePicker, where the first part of that aria-label is the aria-label or label of DateTimePicker. Due to an API design issue, we also have methods setDateAriaLabel and setTimeAriaLabel set these suffixes despite their name suggesting they set the whole aria-label (overriding the default aria-label format). Ideally, they would be changed to set the whole aria-label while suffixes would only be set through i18n. However, this would be a significant breaking change, which is too big to be included in a minor version. So, for now, it was decided to keep these properties in i18n and also retain these methods, with the difference that the methods will store their labels separately from i18n and their labels will take precedence over the labels set through i18n to avoid undesired side effects.

Part of #4618

Type of change

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

vaadin-bot commented 2 months ago

This ticket/PR has been released with Vaadin 24.5.0.alpha5 and is also targeting the upcoming stable 24.5.0 version.