This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Getting MEAN with Mongo, Express, Angular, and Node and have Simon Holmes on-line!
See this thread for details.
The moose likes Struts and the fly likes Language/locale from Accept-Language header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Language/locale from Accept-Language header" Watch "Language/locale from Accept-Language header" New topic
Author

Language/locale from Accept-Language header

Rick DeBay
Ranch Hand

Joined: Jul 11, 2003
Posts: 70
Given the header: Accept-Language: da, en-gb;q=0.8, en;q=0.7
and message files for en_US and es_US, what locale will struts automagically set for the user?
Rick DeBay
Ranch Hand

Joined: Jul 11, 2003
Posts: 70
Given the rules for ResourceBundles, the resource used should be SomeResource_en. I would hope that the Locale set would be en_GB, and not da or the default.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Language/locale from Accept-Language header