internationalization - RFC2616 algorithm for default content using Accept-Language header -
i'm designing web service has content stored in database, , want ensure design compliant rfc2616. however, i'm little unclear on correct way match content.
if specify behaviour user story:
given request content in 'en_gb' when server has content in 'en_us' , server has content in 'en_ca' , server not have content in 'en' server should return content in '???'
question: language should server return content in?
update: based on pawel-dyda's answer, believe stories should this:
given request content in 'en_gb' when server has content in 'en_us' , server has content in 'en_ca' , server has content in 'en' server should return content in 'en' given request content in 'en_gb' when server has content in 'en_us' , server has content in 'en_ca' , server not have content in 'en' server should return content in server default language
what want locale fallback. http accept-language header i18n best practice rules are:
- given lang-country pair return contents if available
- then try return content given language, if available
- then try next language on list (start 1)
- if nothing works far, return (application | server) default language.
for example, assuming application contains german translation (de) , http accept-language header looks like:
accept-language: fr-fr, de-at;q=0.7
the language returned should german (de).
going question, should return default locale. , have common resources given language (en in case).
Comments
Post a Comment