You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Partially address #11. Add mention of JSON-LD including reference. Add text discussing string internationalization and language maps from JSON-LD 1.1, including links. Fix language tags in language map example.
<p>Notice that this format embeds the <kbd>lang</kbd> field both as a key in the array and inside the enclosed <kbd>Localizable</kbd> so that the selected or preferred value can easily be extracted as a complete JavaScript or JSON object.</p>
445
445
<p>For example, if the language selected is English (<kbd>en</kbd>), it is easy to extract the object <kbd>{ "value": "Moby Dick", "lang": "en" }</kbd> for inclusion into another data format.</p>
@@ -489,8 +489,8 @@ <h2>Current Best Practices for Tagging Language and Direction</h2>
@@ -645,7 +645,7 @@ <h2>Require HTML or XML for content</h2>
645
645
646
646
647
647
<sectionid="langapproach2">
648
-
<h2>Create a new datatype in JSON-LD</h2>
648
+
<h2>Create a new datatype</h2>
649
649
<p>If a new datatype were added to JSON to support natural language strings, then specifications could easily specify that type for use in document formats. Since the format is standardized, <adata-lt="producer">producers</a> and <adata-lt="consumer">consumers</a> would not need to guess about direction or language information when it is encoded. Such a serialization might look like the following:</p>
650
650
651
651
<preclass=example>
@@ -656,6 +656,10 @@ <h2>Create a new datatype in JSON-LD</h2>
<p>The downside of adding a datatype is that JSON is a widely implemented format, including many ad-hoc implementations. Any new serialization form would likely break or cause interoperability problems with these existing implementations. JSON is not designed to be a "versioned" format. Any serialization form used would need to be transparent to existing JSON processors and thus could introduce unwanted data or data corruption to existing fields and formats.</p>
659
+
660
+
<p>[[JSON-LD]] includes some data structures that are partially helpful. Notably, it defines <ahref="https://json-ld.org/spec/latest/json-ld/#string-internationalization">string internationalization</a> in the form of a context-scoped <kbd>@language</kbd> value which can be associated with blocks of JSON or within individual objects. There is no definition of base direction, so this is incomplete. The <kbd>@context</kbd> concept can be used by specifications as a means of indicating the default language metadata where omitted from individual strings.</p>
661
+
662
+
<p>The concept of <ahref="https://json-ld.org/spec/latest/json-ld/#language-indexing">language indexing</a> in JSON-LD is used in the Best Practices in this document as a means for localizing a data value.</p>
0 commit comments