[MAGNOLIA-7897] Provide Compatibility And Documentation for Changing Java 7 Locale Names To Java 8 Created: 28/Sep/20 Updated: 31/Jan/23 Resolved: 06/Oct/20 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.4 |
| Type: | Task | Priority: | Neutral |
| Reporter: | Julian Nodarse | Assignee: | Aleksandr Pchelintcev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | maintenance | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 0.05h | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Template: |
|
||||||||||||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||||||||||||||
| Task DoR: |
Empty
|
||||||||||||||||||||||||||||||||||||
| Release notes required: |
Yes
|
||||||||||||||||||||||||||||||||||||
| Documentation update required: |
Yes
|
||||||||||||||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||||||||||||||
| Epic Link: | Java8 locales | ||||||||||||||||||||||||||||||||||||
| Sprint: | Maintenance 27, Maintenance 28 | ||||||||||||||||||||||||||||||||||||
| Description |
|
Since we’ve upgraded to Magnolia 6.x, we have been using the newer supported locale names for Java 8 which replaces the locale names for Java 7. This change includes switching the “_” character to a “-”, for example “en_GB” to “en-GB”. As a result, custom code from users who have been using the older format do not have any steps on how to use their old code with the new format. Documentation does not warn users of this change either, nor is there any documentation for users on how to go about managing this code with the new locale names. |
| Comments |
| Comment by Roman Kovařík [ 01/Oct/20 ] |
|
I think this an important incompatibility a we should either
For the record, info.magnolia.context.UserContextImpl#setLocaleFor uses the old syntax as well. |
| Comment by Aleksandr Pchelintcev [ 06/Oct/20 ] |
|
Looks like the behaviour switched as we moved with the module config registry: N2B would use the LocaleUtil while now M2B uses whatever the BeanUtils has configured:
Locale.forLanguageTag((String) value)
Probably making the configured converter fallback to LocaleUtil will do the trick |
| Comment by Roman Kovařík [ 06/Oct/20 ] |
|
info.magnolia.ui.datasource.locale.LocaleSelectFieldSupport#defaultConverter (locale suffix for properties in UI) suffers from the same issue. |
| Comment by Sang Ngo Huu [ 13/Oct/20 ] |
|
QA note: Created |