Skip to content

Commit e9d3e52

Browse files
authored
Merge pull request #190 from reconciliation-api/138-langDirSchemas
Add `lang` & `dir` to all relevant schemas
2 parents cc847e5 + dd1a173 commit e9d3e52

11 files changed

+133
-8
lines changed

1.0-draft/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ <h3>Text-processing language</h3>
965965

966966
<p>All objects used in this protocol (entities, types, properties, queries, candidates, features, etc.) MAY declare an explicit <a>text-processing language</a> in a <code>lang</code> field.
967967
The <code>lang</code> value MUST be a single valid (i.e. found in the [[IANA Language Subtag Registry]]) [[BCP 47]] language tag. This text-processing language applies to the natural language fields of the object: <code>name</code>, <code>description</code>,
968-
<code>query</code> (for <a>reconciliation queries</a>), <code>v</code> and <code>str</code> (for <a>property values</a>). Nested objects inherit the text-processing language of their parent, and can override it by setting their own <code>lang</code> value
968+
<code>query</code> (for <a>reconciliation queries</a>), <code>v</code> and <code>str</code> (for <a>property values</a>), <code>helpText</code> (for <a>data extension property settings</a>). Nested objects inherit the text-processing language of their parent, and can override it by setting their own <code>lang</code> value
969969
(see example below). A default text-processing language for any natural language string returned or processed by a service MAY be set in the <code>lang</code> field of the <a href="#service-manifest">service manifest</a>.
970970
Client and service implementors SHOULD consider the text-processing language to ensure correct processing of natural language content.</p>
971971

@@ -981,7 +981,7 @@ <h3>Text direction</h3>
981981

982982
<p>All objects returned by reconciliation services (entities, types, properties, candidates, features, etc.) MAY declare an explicit text <a href="https://www.w3.org/International/articles/inline-bidi-markup/uba-basics">
983983
base direction</a> in a <code>dir</code> field. The <code>dir</code> value MUST be <code>ltr</code> for left-to-right, <code>rtl</code> for right-to-left, or <code>auto</code> for determining the direction by examining the content of each JSON field.
984-
This base direction applies to the natural language fields of the object: <code>name</code> and <code>description</code> (for candidates etc.), <code>v</code> and <code>str</code> (for <a>property values</a>).
984+
This base direction applies to the natural language fields of the object: <code>name</code> and <code>description</code> (for candidates etc.), <code>v</code> and <code>str</code> (for <a>property values</a>), <code>helpText</code> (for <a>data extension property settings</a>).
985985
Nested objects inherit the base direction of their parent, and can override it by setting their own <code>dir</code> value. A default base direction for any natural language string returned or processed by a service MAY be set in the <code>dir</code> field of the
986986
<a href="#service-manifest">service manifest</a>. If no explicit base direction is given, left-to-right is considered the default base direction. Clients SHOULD consider the base direction to ensure correct rendering of content, e.g. by setting corresponding <code>dir</code> attributes when rendering JSON responses in HTML.
987987
For instance, rendering a Persian label for 'Yahoo!' like <code>یاهو!</code> right-to-left will correctly display as <code dir="rtl">یاهو!</code>.</p>

1.0-draft/schemas/data-extension-property-proposal.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
"description": {
2121
"type": "string",
2222
"description": "An optional description which can be provided to disambiguate namesakes, providing more context."
23+
},
24+
"lang": {
25+
"$ref": "lang.json"
26+
},
27+
"dir": {
28+
"$ref": "dir.json"
2329
}
2430
},
2531
"required": [

1.0-draft/schemas/data-extension-response.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
"name": {
1616
"type": "string"
1717
},
18+
"lang": {
19+
"$ref": "lang.json"
20+
},
21+
"dir": {
22+
"$ref": "dir.json"
23+
},
1824
"type": {
1925
"type": "object",
2026
"properties": {
@@ -23,6 +29,12 @@
2329
},
2430
"name": {
2531
"type": "string"
32+
},
33+
"lang": {
34+
"$ref": "lang.json"
35+
},
36+
"dir": {
37+
"$ref": "dir.json"
2638
}
2739
},
2840
"required": [
@@ -81,10 +93,10 @@
8193
"type": "string"
8294
},
8395
"lang": {
84-
"type": "string"
96+
"$ref": "lang.json"
8597
},
8698
"dir": {
87-
"type": "string"
99+
"$ref": "dir.json"
88100
}
89101
},
90102
"required": [
@@ -100,10 +112,10 @@
100112
"type": "string"
101113
},
102114
"lang": {
103-
"type": "string"
115+
"$ref": "lang.json"
104116
},
105117
"dir": {
106-
"type": "string"
118+
"$ref": "dir.json"
107119
}
108120
},
109121
"required": [

1.0-draft/schemas/dir.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$id": "https://reconciliation-api.github.io/specs/draft/schemas/dir.json",
3+
"type": "string",
4+
"enum": [
5+
"ltr",
6+
"rtl",
7+
"auto"
8+
],
9+
"description": "The text direction for the natural language fields of this object"
10+
}

1.0-draft/schemas/lang.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$id": "https://reconciliation-api.github.io/specs/draft/schemas/lang.json",
3+
"type": "string",
4+
"description": "The text-processing language for the natural language fields of this object"
5+
}

1.0-draft/schemas/manifest.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
"type": "string",
1919
"description": "A human-readable name for the service or data source"
2020
},
21+
"lang": {
22+
"$ref": "lang.json"
23+
},
24+
"dir": {
25+
"$ref": "dir.json"
26+
},
2127
"documentation": {
2228
"type": "string",
2329
"description": "A URI which hosts documentation about this service"
@@ -136,6 +142,12 @@
136142
},
137143
"helpText": {
138144
"type": "string"
145+
},
146+
"lang": {
147+
"$ref": "lang.json"
148+
},
149+
"dir": {
150+
"$ref": "dir.json"
139151
}
140152
},
141153
"required": [
@@ -165,6 +177,12 @@
165177
},
166178
"helpText": {
167179
"type": "string"
180+
},
181+
"lang": {
182+
"$ref": "lang.json"
183+
},
184+
"dir": {
185+
"$ref": "dir.json"
168186
}
169187
},
170188
"required": [
@@ -194,6 +212,12 @@
194212
},
195213
"helpText": {
196214
"type": "string"
215+
},
216+
"lang": {
217+
"$ref": "lang.json"
218+
},
219+
"dir": {
220+
"$ref": "dir.json"
197221
}
198222
},
199223
"required": [
@@ -224,6 +248,12 @@
224248
"helpText": {
225249
"type": "string"
226250
},
251+
"lang": {
252+
"$ref": "lang.json"
253+
},
254+
"dir": {
255+
"$ref": "dir.json"
256+
},
227257
"choices": {
228258
"type": "array",
229259
"items": {
@@ -234,6 +264,12 @@
234264
},
235265
"name": {
236266
"type": "string"
267+
},
268+
"lang": {
269+
"$ref": "lang.json"
270+
},
271+
"dir": {
272+
"$ref": "dir.json"
237273
}
238274
},
239275
"required": [

1.0-draft/schemas/reconciliation-query-batch.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
},
2525
"name": {
2626
"type": "string"
27+
},
28+
"lang": {
29+
"$ref": "lang.json"
30+
},
31+
"dir": {
32+
"$ref": "dir.json"
2733
}
2834
},
2935
"required": [
@@ -52,8 +58,10 @@
5258
"description": "The maximum number of candidates to return"
5359
},
5460
"lang": {
55-
"type": "string",
56-
"description": "The text-processing language for the query"
61+
"$ref": "lang.json"
62+
},
63+
"dir": {
64+
"$ref": "dir.json"
5765
},
5866
"conditions": {
5967
"type": "array",

1.0-draft/schemas/reconciliation-result-batch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
"type": "string",
3131
"description": "Optional description of the candidate entity"
3232
},
33+
"lang": {
34+
"$ref": "lang.json"
35+
},
36+
"dir": {
37+
"$ref": "dir.json"
38+
},
3339
"image": {
3440
"type": "string",
3541
"description": "Optional URL of an image illustrating the entity"
@@ -52,6 +58,12 @@
5258
"type": "string",
5359
"description": "A human-readable name for the feature"
5460
},
61+
"lang": {
62+
"$ref": "lang.json"
63+
},
64+
"dir": {
65+
"$ref": "dir.json"
66+
},
5567
"value": {
5668
"description": "The value of the feature for this reconciliation candidate",
5769
"oneOf": [
@@ -89,6 +101,12 @@
89101
},
90102
"name": {
91103
"type": "string"
104+
},
105+
"lang": {
106+
"$ref": "lang.json"
107+
},
108+
"dir": {
109+
"$ref": "dir.json"
92110
}
93111
},
94112
"required": [

1.0-draft/schemas/suggest-entities-response.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
"type": "string",
2222
"description": "An optional description which can be provided to disambiguate namesakes, providing more context."
2323
},
24+
"lang": {
25+
"$ref": "lang.json"
26+
},
27+
"dir": {
28+
"$ref": "dir.json"
29+
},
2430
"image": {
2531
"type": "string",
2632
"description": "An optional URL of an image which illustrates the entity, letting users identify it visually."
@@ -39,6 +45,12 @@
3945
},
4046
"name": {
4147
"type": "string"
48+
},
49+
"lang": {
50+
"$ref": "lang.json"
51+
},
52+
"dir": {
53+
"$ref": "dir.json"
4254
}
4355
},
4456
"required": [

1.0-draft/schemas/suggest-properties-response.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
"type": "string",
2222
"description": "An optional description which can be provided to disambiguate namesakes, providing more context."
2323
},
24+
"lang": {
25+
"$ref": "lang.json"
26+
},
27+
"dir": {
28+
"$ref": "dir.json"
29+
},
2430
"matchQualifiers": {
2531
"type": "array",
2632
"description": "An optional array of objects representing the matchQualifiers supported for the suggested property",
@@ -34,6 +40,12 @@
3440
"name": {
3541
"type": "string",
3642
"description": "Name of the matchQualifier"
43+
},
44+
"lang": {
45+
"$ref": "lang.json"
46+
},
47+
"dir": {
48+
"$ref": "dir.json"
3749
}
3850
},
3951
"required": [

0 commit comments

Comments
 (0)