Skip to main content

Language tags

Every key of a LanguageProperty's languageMap is a well-formed BCP 47 language tag or @none, so en_US is refused. An @language on a value is a well-formed BCP 47 tag as well, and a value can't carry both @language and @type.

Each range in the lang parameter is * or a well-formed BCP 47 tag, with quality values written the HTTP way. A merge takes exactly one tag in lang.

The […] at the end of a q or orderBy attribute path names a target language, and it has to fit the name grammar. color[en] works, but marque[en-GB] is refused, because a name can't hold -. Annex C does print q=marque[en-GB]=="Vauxhall Viva", but the annex is informative. The Target languages in q extension accepts full tags at its language-tags level, and ranges such as [de-*-DE] at its language-ranges level.

A target language matches a languageMap key when the two tags are equal, ignoring case. [en-gb] selects the key written en-GB, but [en] doesn't select en-GB.

A merge compares the languages it writes with the stored keys the same way, so EN replaces a stored en. The strings written for a language replace all the stored strings of that language, so merging {"en": ["x", "y"]} into {"en": ["one", "two"]} leaves ["x", "y"]. Languages the merge doesn't name are left alone.