Reading through the HTTP specification I came across the terms “language-tag” and “language-range”. The standard defines the difference between these two entities as the following:
A language-range matches a language-tag if it exactly equals the tag, or if it exactly equals a prefix of the tag such that the first tag character following the prefix is "-".
However, the document doesn’t augment this statment by any of examples. So, how does the language-range differ from the language-tag in the following HTTP header field:
Accept-Language: en, en-gb, en-us
And if they don’t differ here, could you give any examples where they do.
Updated
I’d rephrase the aforementioned citation in the following manner:
A language is considered acceptable if its tag or the tag’s prefix exactly equals a language range which was specified in the Accept-Language field.
The RFC does provide an example. If you look at the specification of the Accept-Language request header:
Section 3.10 mentions:
So all language tags are registered here. Enter RFC 2616:
So,
eninAccept-Language: enmatchesen-gbanden-US. If the client expects multiple matches for a single range, it should specify the subtags and assign a quality value (;q=) per subtag for best results.If it doesn’t, the server gets to decide which available representation it will return.