[MGNLREST-262] zh_CN Language Tag does not work properly Created: 23/Jul/20  Updated: 04/Apr/22

Status: Accepted
Project: Magnolia REST Framework
Component/s: delivery
Affects Version/s: 2.1.4, 2.2, 2.2.1
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Tobias Kerschbaum Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: quickwin
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2020-07-23-15-12-21-340.png     PNG File image-2020-07-23-15-14-31-381.png    
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

 Description   

Our partner dotSource has a problem with the content delivery endpoint. They have a multi-language site with 7 different languages. One of them is Taiwan (zh_CN). According to our documentation the configuration should look like this:

 
So the node name is “zh_CN”. But when i do it like this and do some test request “localhost:8080/.rest/delivery/tours/v1?lang=zh_CN” i get the following error message:
{
"error":

{ "code": "badRequest", "message": "Language parameter: zh_CN is not allowed" }

}
 
After some debugging i found out that the class “I18nContainerRequestFilter” checks if the languageTag is valid “isValidLanguageTag”. But the right language Tag seems to be “zh-CN”.

 
Everything works fine if i do the request like this: “localhost:8080/.rest/delivery/tours/v1?lang=zh-CN”
 
dotSource tested with magnolia-rest-content-delivery-2.1.4
I tested with magnolia-rest-content-delivery-2.2 with the standard Travel Demo
 
The expectation from dotSource is that the API takes the same language tag wich our templating function is providing. -> https://documentation.magnolia-cms.com/display/DOCS62/cmsfn#cmsfn-Getlocalizedlinks
 
 


Generated at Mon Feb 12 06:58:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.