From 125abf707146ddd96d3aeb50db8d98031cabd1f3 Mon Sep 17 00:00:00 2001
From: Manu Sporny Internationalization Considerations
standards or protocols implementation, ignoring internationalization makes it
difficult for data to be produced and consumed across a disparate set of
languages and societies, which would limit the applicability of the
-specification and significantly diminish its value as a standard.
+specification and significantly diminish its value as a global standard.
@@ -4683,82 +4683,134 @@
-When expressing human-readable text content in the data model, it is important -for presentation, accessibility, and further processing to specify the language -of the text, as follows: +Data publishers are strongly encouraged to use the design pattern described +in this section when expressing simple internationalized strings in +JSON, JSON-LD, or similar data formats to ensure the broadest interoperability +across syntaxes. The design pattern is a result of extensive collaboration +between the W3C Internationalization Activity, the Linked Data Community, and +developers that primarily utilize JSON and CBOR to publish information.
-@language feature, as described in [[!JSON-LD]] 1.1,
-Section 4.2.3: String Internationalization.
- rdf:HTML string literal type, as described in [[!JSON-LD]] 1.0,
+ +The general design pattern is to use the following markup template when +expressing a text string that is tagged with a language and, optionally, a +specific text direction: +
+ ++"property": { + "value": "The string value", + "language: "+ +LANGUAGE-x-d-DIRECTION" +} +
+An example utilizing the design pattern above is shown below to express the +human-readable text "revoked" in the English language without specifying a +text direction: +
+ +
+"statusReason": {
+ "value": "Revoked",
+ "language: "en"
+}
+
+
+ +The next example expresses the human-readable text "revoked" in the Arabic +language using a right-to-left text layout: +
+ +
+"statusReason": {
+ "value": "إلغاء",
+ "language: "ar-x-d-rtl"
+}
+
+
+
+Utilization of the design pattern above assumes that the
+The JSON-LD extension associated with the
+property utilizes the @scoped feature of JSON-LD to
+alias the @language and @value keywords to
+language and value, respectively.
+
+When multiple languages are utilized in the same value, a more complex
+mechanism is required. [[!JSON-LD]] also supports the expression of language
+information using the rdf:HTML string literal type, as described
+in [[!JSON-LD]],
Section 4.2.1: Typed Values.
This mechanism enables developers to use the internationalization features
present in HTML to express language information. For example, consider the
following key-value pair:
-
-"nameHtml": "<span lang="jp">和美</span>" ++"nameHtml": "<span lang="en">Kazumi</span> (<span lang="jp">和美</span>)"If the JSON-LD Context expressed that any value associated with the
nameHtmlproperty as being of typerdf:HTML, then software agents rendering the property can deterministically identify the -language in use. +various languages in use. JSON implementations following the +@contextordering requirements in this specification will also be +able to benefit from this feature.
-When expressing human-readable text content in the data model, it is important -to be able to explicitly encode the text direction. JSON and its derived formats -use the UTF-8 encoding of [[Unicode]] for serializing and transmitting text. -This enables text direction to be directly determined in simple cases, -but the mechanism is insufficient for general use. -
+
-[[!JSON-LD]] supports the expression of text layout information using the
-rdf:HTML string literal type, as described in [[!JSON-LD]] 1.0,
-Section 4.2.1: Typed Values.
+When multiple text directions are utilized in the same value, a more
+complex markup mechanism is required. [[!JSON-LD]] supports the expression of
+text layout information using the rdf:HTML string literal type,
+as described in [[!JSON-LD]], Section 4.2.1: Typed Values.
This mechanism enables developers to use the internationalization features
-present in HTML to express language information. For example, consider the
-following key-value pair:
-
-
-"nameHtml": "<span dir="rtl" lang="ar">HTML و CSS: تصميم و إنشاء مواقع الويب</span>" +present in HTML to express text direction information. For example, consider the +following key-value pair (line breaks added for readability): + ++"descriptionHtml": "<span lang="en" dir="ltr">The country names include + <span lang="ar" dir="rtl">مصر</span> and + <span lang="he" dir="rtl">ישראל</span>. + </span>"If the JSON-LD Context states that any value associated with the
nameHtmlproperty is of typerdf:HTML, then software agents have sufficient information to deterministically identify the text -direction of the language. +direction of the language, even if the direction changes within the same string. +JSON implementations following the@contextordering requirements +in this specification will also be able to benefit from this feature.
In some situations it is common to use Ruby characters -to ensure text information is clear and as useful as possible. -[[!JSON-LD]] support for HTML data allows text to be encoded with ruby, -supporting these cases. +to ensure text information, such as how to pronounce a particular glyph, +is clear and as useful as possible. [[!JSON-LD]] support for HTML data, +as described in Section and +Section allows text to be encoded +utilizing Ruby, supporting these use cases.
The W3C Internationalisation document [[string-meta]] gives more information about the need to be able to provide reliable metadata about text to support -internationalization. +internationalization. Implementers are also urged to read the +Implementation Guidance [[VC-IMP-GUIDE]] for the latest information related +to this topic.
From 1178e2411158b948cdc48f18432222d8ea3c5397 Mon Sep 17 00:00:00 2001 From: Manu Sporny
-Utilization of the design pattern above assumes that the
-The JSON-LD extension associated with the
-property utilizes the @scoped feature of JSON-LD to
+
+Utilization of the design pattern above assumes that the JSON-LD
+extension associated with the
+property utilizes the Scoped Context feature of JSON-LD to
alias the @language and @value keywords to
-language and value, respectively.
+language and value, respectively. An example of
+a JSON-LD Context snippet doing so is shown below:
+"statusReason": {
+ "@context": {"value": "@value", "language": "@language"},
+ "@id": "https://www.w3.org/2018/credentials/examples#statusReason"
+}
+
+
+Implementers are strongly advised to read the Requirements for +Language and Direction Metadata in Data Formats [[STRING-META]] published by +the W3C Internationalization Activity as it elaborates upon the +need to provide reliable metadata about text in order to support +internationalization. Implementers are also urged to read the Implementation +Guidance [[VC-IMP-GUIDE]] for the latest information related to this topic. +
+This section outlines general internationalization considerations to take into account when utilizing this data model. @@ -4687,11 +4696,13 @@
Data publishers are strongly encouraged to use the design pattern described -in this section when expressing simple internationalized strings in +in this section when expressing natural language strings in JSON, JSON-LD, or similar data formats to ensure the broadest interoperability across syntaxes. The design pattern is a result of extensive collaboration between the W3C Internationalization Activity, the Linked Data Community, and -developers that primarily utilize JSON and CBOR to publish information. +developers that primarily utilize JSON and CBOR to publish information. The +pattern is useful for the vast majority of language and base direction use +cases that implementers of this specification will need to support.
@@ -4700,10 +4711,10 @@
+"property": { "value": "The string value", - "language: "@@ -4722,13 +4733,13 @@LANGUAGE-x-d-DIRECTION" + "language: "LANGUAGE-x-dir-DIRECTION" }Language and Direction
The next example expresses the human-readable text "revoked" in the Arabic -language using a right-to-left text layout: +language with a base direction of right-to-left:
-+"statusReason": { "value": "إلغاء", - "language: "@@ -4741,7 +4752,7 @@ar-x-d-rtl" + "language: "ar-x-dir-rtl" }Language and Direction
a JSON-LD Context snippet doing so is shown below: -+"statusReason": { "@context": {"value": "@value", "language": "@language"}, "@id": "https://www.w3.org/2018/credentials/examples#statusReason" @@ -4751,86 +4762,80 @@Language and Direction
-When multiple languages are utilized in the same value, a more complex
-mechanism is required. [[!JSON-LD]] also supports the expression of language
-information using the rdf:HTML string literal type, as described
-in [[!JSON-LD]],
+
+When multiple languages, base directions, and annotations are used in a single
+natural language string, more complex mechanisms are typically required.
+[[!JSON-LD]] supports the expression of language information using the
+rdf:HTML string literal type, as described in [[!JSON-LD]],
Section 4.2.1: Typed Values.
This mechanism enables developers to use the internationalization features
-present in HTML to express language information. For example, consider the
-following key-value pair:
+present in HTML to express a variety of language and base direction information.
+For example, consider the following key-value pair that expresses two languages
+in the same natural language text string:
-
+-"nameHtml": "<span lang="en">Kazumi</span> (<span lang="jp">和美</span>)" -+
+
If the JSON-LD Context expressed that any value associated with the
nameHtml property as being of type rdf:HTML, then
software agents rendering the property can deterministically identify the
various languages in use. JSON implementations following the
@context ordering requirements in this specification will also be
able to benefit from this feature.
-
-When multiple text directions are utilized in the same value, a more
-complex markup mechanism is required. [[!JSON-LD]] supports the expression of
-text layout information using the rdf:HTML string literal type,
-as described in [[!JSON-LD]], Section 4.2.1: Typed Values.
-This mechanism enables developers to use the internationalization features
-present in HTML to express text direction information. For example, consider the
-following key-value pair (line breaks added for readability):
+
+This feature is also useful when mixing languages and base direction in a +single natural language string: +
--"descriptionHtml": "<span lang="en" dir="ltr">The country names include - <span lang="ar" dir="rtl">مصر</span> and - <span lang="he" dir="rtl">ישראל</span>. +-+"descriptionHtml": "<span lang="en" dir="ltr">The country names include + <span lang="ar" dir="rtl">مصر</span> and + <span lang="he" dir="rtl">ישראל</span>. </span>" -+
+
If the JSON-LD Context states that any value associated with the
nameHtml property is of type rdf:HTML, then software
-agents have sufficient information to deterministically identify the text
+agents have sufficient information to deterministically identify the base
direction of the language, even if the direction changes within the same string.
-JSON implementations following the @context ordering requirements
-in this specification will also be able to benefit from this feature.
In some situations it is common to use Ruby characters to ensure text information, such as how to pronounce a particular glyph, -is clear and as useful as possible. [[!JSON-LD]] support for HTML data, -as described in Section and -Section allows text to be encoded -utilizing Ruby, supporting these use cases. +is clear and as useful as possible. +
+ +
+"descriptionHtml": "これは<ruby><rb>紙芝居</rb><rt>かみしばい</rt></ruby>です。"
+
+
+
+The markup above would result in the following rendered string in a
+software system that is capable of rendering Ruby markup:
+これは
-The W3C Internationalisation document [[string-meta]] gives more information
-about the need to be able to provide reliable metadata about text to support
-internationalization. Implementers are also urged to read the
-Implementation Guidance [[VC-IMP-GUIDE]] for the latest information related
-to this topic.
+An example of a JSON-LD Context snippet that sets a datatype of
+rdf:HTML is shown below:
+"descriptionHtml": {
+ "@type": "rdf:HTML",,
+ "@id": "https://www.w3.org/2018/credentials/examples#descriptionHtml"
+}
+
+
@@ -4724,7 +4724,7 @@
+"statusReason": { "value": "Revoked", "language: "en" From ba0ca29749f545bfe17d63d4b5f43887a4c01a3e Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 26 May 2019 14:20:26 -0400 Subject: [PATCH 05/19] Fix i18n examples throughout specification. --- index.html | 62 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/index.html b/index.html index b8934fa89..d2d1717db 100644 --- a/index.html +++ b/index.html @@ -916,7 +916,16 @@ Concrete Lifecycle Example
// identifier for the only subject of the credential "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", // assertion about the only subject of the credential - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "language": "en" + }, { + "value": "Exemple d'Université", + "language": "fr" + }] + } }, // digital proof that makes the credential tamper-evident // see the NOTE at end of this section for more detail @@ -965,7 +974,16 @@Concrete Lifecycle Example
"issuanceDate": "2010-01-01T19:73:24Z", "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "language": "en" + }, { + "value": "Exemple d'Université", + "language": "fr" + }] + } }, "proof": { "type": "RsaSignature2018", @@ -1084,7 +1102,7 @@Contexts
"type": ["VerifiableCredential", "AlumniCredential"], "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": "Example University" }, "proof": { ... } } @@ -1180,7 +1198,7 @@Identifiers
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1253,7 +1271,7 @@Types
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1458,7 +1476,7 @@Credential Subject
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1502,7 +1520,7 @@Issuer
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1551,7 +1569,7 @@Issuance Date
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1611,7 +1629,7 @@Proofs (Signatures)
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { @@ -1676,7 +1694,7 @@Expiration
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1735,7 +1753,7 @@Status
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "credentialStatus": { @@ -2360,7 +2378,7 @@Data Schemas
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "credentialSchema": { @@ -2404,7 +2422,7 @@Data Schemas
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "credentialSchema": { @@ -2496,7 +2514,7 @@Refreshing
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "refreshService": { @@ -2579,7 +2597,7 @@Terms of Use
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "termsOfUse": [{ @@ -2620,7 +2638,7 @@Terms of Use
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -2714,7 +2732,7 @@Evidence
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "evidence": [{ @@ -2852,7 +2870,7 @@Zero-Knowledge Proofs
"familyName": "Doe", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>", + "name": "Bachelor of Science and Arts", "college": "College of Engineering" } }, @@ -3518,7 +3536,7 @@JWT Decoding
"credentialSubject": { "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } } } @@ -4017,7 +4035,7 @@Bearer Credentials
// note that the 'id' property is not specified for bearer credentials "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -4472,7 +4490,7 @@Content Integrity Protection
"credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "image": "https://example.edu/images/58473", - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": "Example University" }, "proof": { ... } } @@ -4499,7 +4517,7 @@Content Integrity Protection
"credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "image": "ipfs:/ipfs/QmXfrS3pHerg44zzK6QKQj6JDk8H6cMtQS7pdXbohwNQfK/image", - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": "Example University" }, "proof": { ... } } From 32633fec59435d6afc043dea9f06fca7a021ff4a Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 26 May 2019 14:24:19 -0400 Subject: [PATCH 06/19] More i18n example fixes. --- index.html | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index d2d1717db..70bff04de 100644 --- a/index.html +++ b/index.html @@ -1102,7 +1102,16 @@ Contexts
"type": ["VerifiableCredential", "AlumniCredential"], "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "alumniOf": "Example University" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "language": "en" + }, { + "value": "Exemple d'Université", + "language": "fr" + }] + } }, "proof": { ... } } @@ -4490,7 +4499,16 @@Content Integrity Protection
"credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "image": "https://example.edu/images/58473", - "alumniOf": "Example University" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "language": "en" + }, { + "value": "Exemple d'Université", + "language": "fr" + }] + } }, "proof": { ... } } @@ -4517,7 +4535,16 @@Content Integrity Protection
"credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "image": "ipfs:/ipfs/QmXfrS3pHerg44zzK6QKQj6JDk8H6cMtQS7pdXbohwNQfK/image", - "alumniOf": "Example University" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "language": "en" + }, { + "value": "Exemple d'Université", + "language": "fr" + }] + } }, "proof": { ... } } From 01133d38f0f28fe958e0fc96bac08c8190f5d900 Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 9 Jun 2019 14:47:56 -0400 Subject: [PATCH 07/19] Update section to defer to string meta for cross-syntax expression. --- index.html | 65 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/index.html b/index.html index 70bff04de..e4d001c0e 100644 --- a/index.html +++ b/index.html @@ -4714,52 +4714,53 @@ Data First Approaches
Internationalization Considerations
-There are a number of internationalization considerations implementers should be -aware of when publishing data described in this specification. As with any web -standards or protocols implementation, ignoring internationalization makes it -difficult for data to be produced and consumed across a disparate set of -languages and societies, which would limit the applicability of the -specification and significantly diminish its value as a standard. +There are a number of internationalization considerations implementers +are advised to be aware of when publishing data described in this specification. +As with any web standards or protocols implementation, ignoring +internationalization makes it difficult for data to be produced and consumed +across a disparate set of languages and societies, which would limit the +applicability of the specification and significantly diminish its value as +a standard.
-Implementers are strongly advised to read the Requirements for -Language and Direction Metadata in Data Formats [[STRING-META]] published by -the W3C Internationalization Activity as it elaborates upon the -need to provide reliable metadata about text in order to support -internationalization. Implementers are also urged to read the Implementation -Guidance [[VC-IMP-GUIDE]] for the latest information related to this topic. +Implementers are strongly advised to read the Strings on the Web: Language and +Direction Metadata document [[STRING-META]] published by the W3C +Internationalization Activity as it elaborates upon the need to provide +reliable metadata about text in order to support internationalization. +Implementers are also urged to read the Implementation Guidance +[[VC-IMP-GUIDE]] for the latest information related to this topic.
This section outlines general internationalization considerations to take into -account when utilizing this data model. +account when utilizing this data model and is intended to highlight specific +parts of the Strings on the Web: Language and Direction Metadata document +[[STRING-META]] that implementers might be interested in perusing.
- Language and Direction
+Language and Base Direction
-Data publishers are strongly encouraged to use the design pattern described -in this section when expressing natural language strings in -JSON, JSON-LD, or similar data formats to ensure the broadest interoperability -across syntaxes. The design pattern is a result of extensive collaboration -between the W3C Internationalization Activity, the Linked Data Community, and -developers that primarily utilize JSON and CBOR to publish information. The -pattern is useful for the vast majority of language and base direction use -cases that implementers of this specification will need to support. +Data publishers are strongly encouraged to read the section on + +Cross-Syntax Expression in order to ensure that the expression of +language and base direction information is possible across multiple expression +syntaxes such as [[JSON-LD]], [[JSON]], and CBOR [[?RFC7049]].
The general design pattern is to use the following markup template when expressing a text string that is tagged with a language and, optionally, a -specific text direction: +specific base direction:
"property": { "value": "The string value", - "language: "@@ -4784,7 +4785,8 @@LANGUAGE-x-dir-DIRECTION" + "lang: "LANGUAGE" + "dir": "DIRECTION" }Language and Direction
"statusReason": { "value": "إلغاء", - "language: "@@ -4792,14 +4794,15 @@ar-x-dir-rtl" + "lang: "ar" + "dir": "rtl" }Language and Direction
Utilization of the design pattern above assumes that the JSON-LD extension associated with the property utilizes the Scoped Context feature of JSON-LD to -alias the@languageand@valuekeywords to -languageandvalue, respectively. An example of -a JSON-LD Context snippet doing so is shown below: +alias the@value,@language, and +@directionkeywords tovalue,lang, +anddir, respectively. An example of a JSON-LD Context snippet +doing so is shown below:"statusReason": { - "@context": {"value": "@value", "language": "@language"}, + "@context": {"value": "@value", "lang": "@language", "dir": "@direction"}, "@id": "https://www.w3.org/2018/credentials/examples#statusReason" }@@ -4828,7 +4831,7 @@Complex Language Markup
If the JSON-LD Context expressed that any value associated with thenameHtmlproperty as being of typerdf:HTML, then software agents rendering the property can deterministically identify the -various languages in use. JSON implementations following the +various languages in use. JSON and CBOR implementations following the@contextordering requirements in this specification will also be able to benefit from this feature. @@ -4876,8 +4879,8 @@Complex Language Markup
"descriptionHtml": { - "@type": "rdf:HTML",, "@id": "https://www.w3.org/2018/credentials/examples#descriptionHtml" + "@type": "rdf:HTML",, }From 8684213394b615c3b4e05461a67a49c163f437a7 Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 9 Jun 2019 15:14:07 -0400 Subject: [PATCH 08/19] Rewrite section on Complex Language Markup. --- index.html | 85 +++++++++++++----------------------------------------- 1 file changed, 20 insertions(+), 65 deletions(-) diff --git a/index.html b/index.html index e4d001c0e..2c1ac9a82 100644 --- a/index.html +++ b/index.html @@ -4773,7 +4773,7 @@ Language and Base Direction
"statusReason": { "value": "Revoked", - "language: "@@ -4810,80 +4810,35 @@en" + "lang: "en" }Language and Base Direction
- From e544fe83ea9600947ae5f2a45925878abd6e8972 Mon Sep 17 00:00:00 2001 From: Manu SpornyComplex Language Markup
+Complex Language Markup
-+
When multiple languages, base directions, and annotations are used in a single natural language string, more complex mechanisms are typically required. -[[!JSON-LD]] supports the expression of language information using the -
rdf:HTMLstring literal type, as described in [[!JSON-LD]], -Section 4.2.1: Typed Values. -This mechanism enables developers to use the internationalization features -present in HTML to express a variety of language and base direction information. -For example, consider the following key-value pair that expresses two languages -in the same natural language text string: - --"nameHtml": "<span lang="en">Kazumi</span> (<span lang="jp">和美</span>)" -- --If the JSON-LD Context expressed that any value associated with the -
- -nameHtmlproperty as being of typerdf:HTML, then -software agents rendering the property can deterministically identify the -various languages in use. JSON and CBOR implementations following the -@contextordering requirements in this specification will also be -able to benefit from this feature. --This feature is also useful when mixing languages and base direction in a -single natural language string: -
- --"descriptionHtml": "<span lang="en" dir="ltr">The country names include - <span lang="ar" dir="rtl">مصر</span> and - <span lang="he" dir="rtl">ישראל</span>. - </span>" -- --If the JSON-LD Context states that any value associated with the -
- -nameHtmlproperty is of typerdf:HTML, then software -agents have sufficient information to deterministically identify the base -direction of the language, even if the direction changes within the same string. --In some situations it is common to use -Ruby characters -to ensure text information, such as how to pronounce a particular glyph, -is clear and as useful as possible. +It is possible to utilize markup languages, such as HTML, to encode +text with multiple language and base directions. It is also +possible to use the
-rdf:HTMLdatatype to encode such values +accurately in JSON-LD.-"descriptionHtml": "これは<ruby><rb>紙芝居</rb><rt>かみしばい</rt></ruby>です。" ---The markup above would result in the following rendered string in a -software system that is capable of rendering Ruby markup: -これは
紙芝居 です。 +Implementers are strongly discouraged from encoding information as HTML +because doing so 1) requires some version of an HTML processor, which +increases the burden of processing language and base direction information, +and 2) increases the security attack surface when utilizing this data model +as blindly processing HTML could result in executing ascript+tag that an attacker injected at some point during the data production process.-An example of a JSON-LD Context snippet that sets a datatype of -
- -rdf:HTMLis shown below: +Implementers considering the use of HTML to encode complex language and +base direction information might consider deconstructing the data into a +format that does not require complex markup, such as an array of elements +that can use a simpler form of language and base direction expression. +If such an approach is not possible, implementers are advised to analyze +how an attacker would use the data to mount injection attacks against a +consumer of the data and deploy mitigations for the identified attacks.-"descriptionHtml": { - "@id": "https://www.w3.org/2018/credentials/examples#descriptionHtml" - "@type": "rdf:HTML",, -} --Date: Sun, 9 Jun 2019 15:21:10 -0400 Subject: [PATCH 09/19] Minor grammar fix to "English text". --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 2c1ac9a82..55aa64dfc 100644 --- a/index.html +++ b/index.html @@ -4778,7 +4778,7 @@ Language and Base Direction
-The next example expresses the human-readable text "revoked" in the Arabic +The next example expresses the English text "revoked" in the Arabic language with a base direction of right-to-left:
From 87d5b6a75db500a1663418544eb8abd470716322 Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 9 Jun 2019 15:23:59 -0400 Subject: [PATCH 10/19] Fix and/ors related to base direction. --- index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 55aa64dfc..5d7fb9b20 100644 --- a/index.html +++ b/index.html @@ -4746,8 +4746,8 @@ Language and Base Direction
Data publishers are strongly encouraged to read the section on Cross-Syntax Expression in order to ensure that the expression of -language and base direction information is possible across multiple expression -syntaxes such as [[JSON-LD]], [[JSON]], and CBOR [[?RFC7049]]. +language and/or base direction information is possible across multiple +expression syntaxes such as [[JSON-LD]], [[JSON]], and CBOR [[?RFC7049]].@@ -4813,10 +4813,10 @@
Language and Base Direction
Complex Language Markup
-When multiple languages, base directions, and annotations are used in a single -natural language string, more complex mechanisms are typically required. +When multiple languages, base directions, and/or annotations are used in a +single natural language string, more complex mechanisms are typically required. It is possible to utilize markup languages, such as HTML, to encode -text with multiple language and base directions. It is also +text with multiple language and/or base directions. It is also possible to use the
@@ -4824,17 +4824,17 @@rdf:HTMLdatatype to encode such values accurately in JSON-LD.Complex Language Markup
Implementers are strongly discouraged from encoding information as HTML because doing so 1) requires some version of an HTML processor, which -increases the burden of processing language and base direction information, +increases the burden of processing language and/or base direction information, and 2) increases the security attack surface when utilizing this data model as blindly processing HTML could result in executing a
scripttag that an attacker injected at some point during the data production process.-Implementers considering the use of HTML to encode complex language and +Implementers considering the use of HTML to encode complex language and/or base direction information might consider deconstructing the data into a format that does not require complex markup, such as an array of elements -that can use a simpler form of language and base direction expression. +that can use a simpler form of language and/or base direction expression. If such an approach is not possible, implementers are advised to analyze how an attacker would use the data to mount injection attacks against a consumer of the data and deploy mitigations for the identified attacks. From ce371e3b5021cbfacf53a90d54418755005590b7 Mon Sep 17 00:00:00 2001 From: Manu Sporny
Date: Sun, 30 Jun 2019 14:15:26 -0400 Subject: [PATCH 11/19] Change "language" to "lang" in examples. --- index.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 5d7fb9b20..147acf5aa 100644 --- a/index.html +++ b/index.html @@ -920,10 +920,10 @@ Concrete Lifecycle Example
"id": "did:example:c276e12ec21ebfeb1f712ebc6f1", "name": [{ "value": "Example University", - "language": "en" + "lang": "en" }, { "value": "Exemple d'Université", - "language": "fr" + "lang": "fr" }] } }, @@ -978,10 +978,10 @@Concrete Lifecycle Example
"id": "did:example:c276e12ec21ebfeb1f712ebc6f1", "name": [{ "value": "Example University", - "language": "en" + "lang": "en" }, { "value": "Exemple d'Université", - "language": "fr" + "lang": "fr" }] } }, @@ -1106,10 +1106,10 @@Contexts
"id": "did:example:c276e12ec21ebfeb1f712ebc6f1", "name": [{ "value": "Example University", - "language": "en" + "lang": "en" }, { "value": "Exemple d'Université", - "language": "fr" + "lang": "fr" }] } }, @@ -3063,7 +3063,7 @@Disputes
"currentStatus": "Disputed", "statusReason": { "value": "Address is out of date.", - "language": "en" + "lang": "en" }, }, "issuer": "https://example.com/people#me", @@ -4503,10 +4503,10 @@Content Integrity Protection
"id": "did:example:c276e12ec21ebfeb1f712ebc6f1", "name": [{ "value": "Example University", - "language": "en" + "lang": "en" }, { "value": "Exemple d'Université", - "language": "fr" + "lang": "fr" }] } }, @@ -4539,10 +4539,10 @@Content Integrity Protection
"id": "did:example:c276e12ec21ebfeb1f712ebc6f1", "name": [{ "value": "Example University", - "language": "en" + "lang": "en" }, { "value": "Exemple d'Université", - "language": "fr" + "lang": "fr" }] } }, From f0b4f5063bad9633a8d0c5407fac3a2408ea4121 Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 30 Jun 2019 14:16:51 -0400 Subject: [PATCH 12/19] Fix minor grammar issues with a11y section. --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 147acf5aa..dd894bfa2 100644 --- a/index.html +++ b/index.html @@ -4672,11 +4672,11 @@ Accessibility Considerations
There are a number of accessibility considerations implementers should be -aware of when processing data described in this specification. As with any web -standards or protocols implementation, ignoring accessibility issues makes -this information unusable to a large subset of the population. It is important -to follow accessibility guidelines and standards, such as [[WCAG21]], to ensure -all people, regardless of ability, can make use of this data. This is +aware of when processing data described in this specification. As with +implementation of any web standard or protocol, ignoring accessibility issues +makes this information unusable to a large subset of the population. It is +important to follow accessibility guidelines and standards, such as [[WCAG21]], +to ensure all people, regardless of ability, can make use of this data. This is especially important when establishing systems utilizing cryptography, which have historically created problems for assistive technologies.
From 34e6d2b32764368fd520bc4579b4199301d2c03b Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 30 Jun 2019 14:24:07 -0400 Subject: [PATCH 13/19] Update reference to STRING-META. --- common.js | 10 +++++----- index.html | 23 ++++++++++++----------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/common.js b/common.js index 211fd0331..68f7297db 100644 --- a/common.js +++ b/common.js @@ -36,14 +36,14 @@ var vcwg = { status: "CG-DRAFT", publisher: "Credentials Community Group" }, - "string-meta": { - title: "Requirements for Language and Direction Metadata in Data Formats", - href: "https://w3c.github.io/string-meta/", + "STRING-META": { + title: "Strings on the Web: Language and Direction Metadata", + href: "https://www.w3.org/TR/string-meta/", authors: [ - "Addison Phillips", + "Addison Phillips", "Richard Ishida" ], - status: "Editors-DRAFT", + status: "WD", publisher: "Internationalization Working Group" }, "LD-PROOFS": { diff --git a/index.html b/index.html index dd894bfa2..fec3c6929 100644 --- a/index.html +++ b/index.html @@ -4724,19 +4724,20 @@ Internationalization Considerations
-Implementers are strongly advised to read the Strings on the Web: Language and -Direction Metadata document [[STRING-META]] published by the W3C -Internationalization Activity as it elaborates upon the need to provide -reliable metadata about text in order to support internationalization. -Implementers are also urged to read the Implementation Guidance -[[VC-IMP-GUIDE]] for the latest information related to this topic. +Implementers are strongly advised to read the +Strings on the Web: Language and Direction Metadata document +[[STRING-META]] published by the W3C Internationalization Activity as it +elaborates upon the need to provide reliable metadata about text in order to +support internationalization. Implementers are also urged to read the +Implementation Guidance [[VC-IMP-GUIDE]] for the latest information related to +this topic.
This section outlines general internationalization considerations to take into account when utilizing this data model and is intended to highlight specific -parts of the Strings on the Web: Language and Direction Metadata document -[[STRING-META]] that implementers might be interested in perusing. +parts of the Strings on the Web: Language and Direction Metadata +document [[STRING-META]] that implementers might be interested in perusing.
@@ -4744,9 +4745,9 @@ Language and Base Direction
Data publishers are strongly encouraged to read the section on - -Cross-Syntax Expression in order to ensure that the expression of -language and/or base direction information is possible across multiple +Cross-Syntax Expression in the Strings on the Web: Language and Direction +Metadata document [[STRING-META]] in order to ensure that the expression +of language and/or base direction information is possible across multiple expression syntaxes such as [[JSON-LD]], [[JSON]], and CBOR [[?RFC7049]].
From 77e1d9f39ad0b63ad95acb2de2d32c5b518fa2f6 Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 30 Jun 2019 14:25:32 -0400 Subject: [PATCH 14/19] Fix "lang" syntax error. --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index fec3c6929..e840e9c70 100644 --- a/index.html +++ b/index.html @@ -4760,7 +4760,7 @@ Language and Base Direction
"property": { "value": "The string value", - "lang: "@@ -4774,7 +4774,7 @@LANGUAGE" + "lang": "LANGUAGE" "dir": "DIRECTION" }Language and Base Direction
"statusReason": { "value": "Revoked", - "lang: "@@ -4786,7 +4786,7 @@en" + "lang": "en" }Language and Base Direction
"statusReason": { "value": "إلغاء", - "lang: "From 905fec016eafc8f02adca4e71ebdba2e49ef989f Mon Sep 17 00:00:00 2001 From: Manu Spornyar" + "lang": "ar" "dir": "rtl" }Date: Sun, 30 Jun 2019 14:26:48 -0400 Subject: [PATCH 15/19] Fix grammar issue spotted by @chaals. --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index e840e9c70..aeff5a129 100644 --- a/index.html +++ b/index.html @@ -4779,8 +4779,7 @@ Language and Base Direction
-The next example expresses the English text "revoked" in the Arabic -language with a base direction of right-to-left: +The next example uses a term in Arabic with a base direction of right-to-left:
From 37daadbc5dc6d3e4a165c6e1393dd27d7eadf1ef Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 30 Jun 2019 14:42:05 -0400 Subject: [PATCH 16/19] Fix example text in i18n section. --- index.html | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index aeff5a129..07f8bf8da 100644 --- a/index.html +++ b/index.html @@ -4737,7 +4737,7 @@ Internationalization Considerations
This section outlines general internationalization considerations to take into account when utilizing this data model and is intended to highlight specific parts of the Strings on the Web: Language and Direction Metadata -document [[STRING-META]] that implementers might be interested in perusing. +document [[STRING-META]] that implementers might be interested in reading.@@ -4767,29 +4767,35 @@ Language and Base Direction
An example utilizing the design pattern above is shown below to express the -human-readable text "revoked" in the English language without specifying a -text direction: +title of a book in the English language without specifying a text direction:
-"statusReason": { - "value": "Revoked", +"title": { + "value": "HTML and CSS: Designing and Creating Websites", "lang": "en" }-The next example uses a term in Arabic with a base direction of right-to-left: +The next example uses a similar title expressed in the Arabic language with a +base direction of right-to-left:
-"statusReason": { - "value": "إلغاء", +"title": { + "value": "HTML و CSS: تصميم و إنشاء مواقع الويب", "lang": "+ar" "dir": "rtl" }+The text above would most likley be rendered incorrectly as left to right +without the explicit expression of language and direction as many systems will +use the first character of a text string to determine text direction. +
+
Utilization of the design pattern above assumes that the JSON-LD extension associated with the @@ -4801,9 +4807,9 @@
Language and Base Direction
-"statusReason": { +"title": { "@context": {"value": "@value", "lang": "@language", "dir": "@direction"}, - "@id": "https://www.w3.org/2018/credentials/examples#statusReason" + "@id": "https://www.w3.org/2018/credentials/examples#title" }From 9956dfa95f15d8a6823aaa672e3042f023adf0a8 Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 30 Jun 2019 14:45:48 -0400 Subject: [PATCH 17/19] Do not assume implementers are using JSON-LD. --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 07f8bf8da..ca6718b37 100644 --- a/index.html +++ b/index.html @@ -4797,10 +4797,10 @@ Language and Base Direction
-Utilization of the design pattern above assumes that the JSON-LD -extension associated with the -property utilizes the Scoped Context feature of JSON-LD to -alias the
@value,@language, and +Implementers utilizing JSON-LD are strongly urged to +extend the JSON-LD Context defining the +internationalized property and utilize the Scoped Context feature of +JSON-LD to alias the@value,@language, and@directionkeywords tovalue,lang, anddir, respectively. An example of a JSON-LD Context snippet doing so is shown below: From 966b34891aba8de46db1b8c1a4e8912ec905b8a7 Mon Sep 17 00:00:00 2001 From: Manu SpornyDate: Sun, 30 Jun 2019 14:47:31 -0400 Subject: [PATCH 18/19] Clarify use of HTML markup per request by @TallTed. --- index.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index ca6718b37..833bdea52 100644 --- a/index.html +++ b/index.html @@ -4828,12 +4828,13 @@ Complex Language Markup
-Implementers are strongly discouraged from encoding information as HTML -because doing so 1) requires some version of an HTML processor, which -increases the burden of processing language and/or base direction information, -and 2) increases the security attack surface when utilizing this data model -as blindly processing HTML could result in executing a
script-tag that an attacker injected at some point during the data production process. +Despite that possibility, implementers are strongly discouraged from encoding +information as HTML because doing so 1) requires some version of an HTML +processor, which increases the burden of processing language and/or base +direction information, and 2) increases the security attack surface when +utilizing this data model as blindly processing HTML could result in executing +ascripttag that an attacker injected at some point during the +data production process.From ea43b2513c9d9b31b6be740a7c52c336256f570b Mon Sep 17 00:00:00 2001 From: Manu Sporny
Date: Sun, 30 Jun 2019 14:52:39 -0400 Subject: [PATCH 19/19] Remove bad i18n advice per @r12a and @aphillips. --- index.html | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 833bdea52..e051d84df 100644 --- a/index.html +++ b/index.html @@ -4838,13 +4838,11 @@ Complex Language Markup
-Implementers considering the use of HTML to encode complex language and/or -base direction information might consider deconstructing the data into a -format that does not require complex markup, such as an array of elements -that can use a simpler form of language and/or base direction expression. -If such an approach is not possible, implementers are advised to analyze -how an attacker would use the data to mount injection attacks against a -consumer of the data and deploy mitigations for the identified attacks. +If implementers feel that they have to use HTML, or other markup languages +that are capable of containing executable scripts, to achieve a particular +use case, they are advised to analyze how an attacker would use the markup to +mount injection attacks against a consumer of the markup and deploy mitigations +for the identified attacks.