[MAGNOLIA-8229] Non JVM-default Locales are not used in I18n Created: 17/Nov/21  Updated: 09/Jun/23  Resolved: 03/Feb/22

Status: Closed
Project: Magnolia
Component/s: freemarker
Affects Version/s: 6.2.13
Fix Version/s: 6.2.17

Type: Bug Priority: Low
Reporter: Chris Jennings Assignee: Javier Benito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 0.5d
Original Estimate: Not Specified

Attachments: Text File oracle_java_11_locales.txt    
Issue Links:
Relates
relates to MGNLREST-730 Only JVM default locales are checked ... Closed
relates to MAGNOLIA-8709 Allow use of IETF Language Tags Accepted
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: Java8 locales
Sprint: DevX 2, DevX 3
Story Points: 5
Team: DeveloperX

 Description   

Steps to reproduce

  1. Create a site definition that supports English (en) as default and Welsh (cy) as a secondary language.
  2. Use the message bundles to translate a label within a Freemarker template.
  3. eg. You will have message bundles my-module-messages_en.properties and my-module-messages_cy.properties and will use the template as documented.

Expected results

When switching between requested languages, the translated label will change from English to Welsh.

Actual results

The Welsh translation appears everywhere, never the English.

Workaround

TBC

Development notes

The DefaultMessageBundlesLoader is, via the LocaleUtils, using the default locales available from the JVM.



 Comments   
Comment by Chris Jennings [ 18/Nov/21 ]

Attached locales available from Oracle Java for reference.

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