[MGNLLDAP-116] Language Culture Name (IETF language tag) is not supported Created: 17/Nov/17  Updated: 17/Jul/20  Resolved: 12/May/20

Status: Closed
Project: LDAP Connector
Component/s: None
Affects Version/s: 1.9.2
Fix Version/s: 1.10.3

Type: Bug Priority: Neutral
Reporter: Viet Nguyen Assignee: Milan Divilek
Resolution: Fixed Votes: 0
Labels: maintenance
Remaining Estimate: 0.25d
Time Spent: 0.5h
Original Estimate: 2.5h

Attachments: PNG File LocaleExample.png    
Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Epic Link: Support
Sprint: Maintenance 5, Maintenance 6
Story Points: 1

 Description   
  • In following up with SUPPORT-7940, we recognize that in term of 'integration' of Magnolia with the rest of the world, we still not very well supported Locale which using IETF language tag - usually adopted by .NET/Microsoft systems.
  • This could be easily fix by rewrite UserContextImpl, this section:
    protected void setLocaleFor(User user) {
            // despite this property being called "language", it sometimes contains the country (i.e. fr_CH), so we need to parse it
            final String userLanguage = user.getLanguage();
            setLocale(LocaleUtils.toLocale(userLanguage));
        }
    

    As flangelier investigated:

    After a little digging we found out that the Language Culture Name (IETF language tag) is not supported by Apache common Lang (ex: fr-CA, fr-FR). From what I understand we can only set Language with Java Locale format (ex: fr_CA, fr_FR).

    --> Then please use this instead:

    Locale.forLanguageTag("fr-CA")
    

    Worked for me as attached image.



 Comments   
Comment by Viet Nguyen [ 17/Nov/17 ]

Work around described in linked ticket.

Generated at Mon Feb 12 02:21:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.