fix for i18n stuff in IE10 and china firefox
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.
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").