w3c / json-ld-syntax

JSON-LD 1.1 Specification
https://w3c.github.io/json-ld-syntax/
Other
112 stars 22 forks source link

4.2.4 or 4.6.2 to note challenge of "en-us" and dot-property notation code #251

Closed azaroth42 closed 4 years ago

azaroth42 commented 5 years ago

Both descriptions of the language map pattern talk about the utility of using object.en as a method of accessing the data. However, neither mention the subsequent headache of "-region" or other BCP47 values beyond the simple two letter code for the language as a whole.

If I use "en-us" as the language of my string then I just broke everyone's dot-property notation code, as they'll try in vain to do:

text = object.occupation.en - us;

and hopefully get a 'Variable Not Defined: us' error, and at worst (if us is defined as something that can be subtracted from a string) some very badly broken content.

This should be in a note in one or both of the descriptions.