[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:
Cloners
is cloned by MGNLUI-6272 Convert strings to locales in LocaleS... Closed
Problem/Incident
causes MGNLDEMO-348 Changing Java 7 Locale Names To Java ... Closed
Relates
relates to MAGNOLIA-8709 Allow use of IETF Language Tags Accepted
causality
documentation
to be documented by DOCU-2059 Ability to support both Java8 and Jav... Closed
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

  • use the old syntax again
  • support both
  • provide an update tasks (to expensive for all workspaces), but we cannot update bootstrap files except for our projects 

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 MGNLDEMO-348 for fixing error on demo project.

Generated at Mon Feb 12 04:27:49 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.