play1 icon indicating copy to clipboard operation
play1 copied to clipboard

fix for i18n stuff in IE10 and china firefox

Open deanhiller opened this issue 12 years ago • 2 comments

Added a unit test where in china, the request from firefox browser was resulting in displaying english which can frustrate users there who have zh_cn as their first language. The previous code picked the first lang match in the list in application.conf instead of the first in the list of the browsers request.

deanhiller avatar Jan 11 '14 13:01 deanhiller

play-1-3-x-pull-requests #144 FAILURE Looks like there's a problem with this pull request

Could you create an issue? Could you fix the test Map<String, Header> headers = new HashMap<>(); only compile for 1.7 Just change it to must be fine Map<String, Header> headers = new HashMap<String, Header>();

Other remark, in your test the request want zh_cn, en or en_us. So that means that the user want one of this exact match. I your webiste is in zh_tw, showing this language instead of the requested zh_cn, is not good neither. As all chinese from china (zh_cn : simplifed character) cannot read Traditional characters (zh_tw), so en will maybe better for them. So as for me, I would prefer the previous behaviour.

But your example show some problem in Play, if the request contains "zh_cn,en;q=0.3,en_us;q=0.7" and play has defined en-us and en, play.getLang should return en_us (as we should consider the q value "relative quality factor").

xael-fry avatar Feb 18 '14 05:02 xael-fry