From 88d4576287075b1b47a14cb4afe8e1cc49e87633 Mon Sep 17 00:00:00 2001
From: Kevin Lind <lind@adobe.com>
Date: Thu, 5 Mar 2020 17:37:18 -0800
Subject: [PATCH 1/2] Add property 'locale' to Environment. The locale property
 is used to state the language of the environment.

---
 .../reference/context/environment.schema.json | 10 ++++++
 docs/reference/context/environment.schema.md  | 31 ++++++++++++++++++-
 schemas/context/environment.schema.json       | 10 ++++++
 3 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/docs/reference/context/environment.schema.json b/docs/reference/context/environment.schema.json
index c94d069cb..475cfd441 100644
--- a/docs/reference/context/environment.schema.json
+++ b/docs/reference/context/environment.schema.json
@@ -137,6 +137,16 @@
                     "title": "Internet service provider",
                     "type": "string",
                     "description": "The name of the user's internet service provider."
+                },
+                "xdm:locale": {
+                    "title": "Language locale code",
+                    "type": "string",
+                    "pattern": "^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$",
+                    "description": "Language used in the environment. The locale code should follow [RFC BCP 47](https://tools.ietf.org/html/bcp47)",
+                    "examples": [
+                        "en-US",
+                        "de-CH"
+                    ]
                 }
             }
         }
diff --git a/docs/reference/context/environment.schema.md b/docs/reference/context/environment.schema.md
index 7c16cbbeb..74efb0b1b 100644
--- a/docs/reference/context/environment.schema.md
+++ b/docs/reference/context/environment.schema.md
@@ -38,7 +38,8 @@ Information about the surrounding situation the event observation occurred, spec
   "xdm:operatingSystemVendor": "Apple",
   "xdm:connectionType": "cable",
   "xdm:domain": "verizon.com",
-  "xdm:ISP": "Verizon"
+  "xdm:ISP": "Verizon",
+  "xdm:locale": "en-US"
 }
 ```
 
@@ -54,6 +55,7 @@ Information about the surrounding situation the event observation occurred, spec
 | [xdm:domain](#xdmdomain) | `string` | Optional | Environment (this schema) |
 | [xdm:ipV4](#xdmipv4) | `string` | Optional | Environment (this schema) |
 | [xdm:ipV6](#xdmipv6) | `string` | Optional | Environment (this schema) |
+| [xdm:locale](#xdmlocale) | `string` | Optional | Environment (this schema) |
 | [xdm:operatingSystem](#xdmoperatingsystem) | `string` | Optional | Environment (this schema) |
 | [xdm:operatingSystemVendor](#xdmoperatingsystemvendor) | `string` | Optional | Environment (this schema) |
 | [xdm:operatingSystemVersion](#xdmoperatingsystemversion) | `string` | Optional | Environment (this schema) |
@@ -240,6 +242,33 @@ The numerical label assigned to a device participating in a computer network tha
 
 
 
+## xdm:locale
+### Language locale code
+
+The language used in the environment. 
+
+`xdm:locale`
+* is optional
+* type: `string`
+* defined in this schema
+
+### xdm:locale Type
+
+
+`string`
+* format: `locale` - Locales are expressed following [RFC BCP47](https://tools.ietf.org/html/bcp47)
+
+All instances must conform to this regular expression 
+(test examples [here](https://regexr.com/?expression=%5E((((%5BA-Za-z%5D%7B2%2C3%7D(-(%5BA-Za-z%5D%7B3%7D(-%5BA-Za-z%5D%7B3%7D)%7B0%2C2%7D))%3F)%7C%5BA-Za-z%5D%7B4%7D%7C%5BA-Za-z%5D%7B5%2C8%7D)(-(%5BA-Za-z%5D%7B4%7D))%3F(-(%5BA-Za-z%5D%7B2%7D%7C%5B0-9%5D%7B3%7D))%3F(-(%5BA-Za-z0-9%5D%7B5%2C8%7D%7C%5B0-9%5D%5BA-Za-z0-9%5D%7B3%7D))*(-(%5B0-9A-WY-Za-wy-z%5D(-%5BA-Za-z0-9%5D%7B2%2C8%7D)%2B))*(-(x(-%5BA-Za-z0-9%5D%7B1%2C8%7D)%2B))%3F)%7C(x(-%5BA-Za-z0-9%5D%7B1%2C8%7D)%2B)%7C((en-GB-oed%7Ci-ami%7Ci-bnn%7Ci-default%7Ci-enochian%7Ci-hak%7Ci-klingon%7Ci-lux%7Ci-mingo%7Ci-navajo%7Ci-pwn%7Ci-tao%7Ci-tay%7Ci-tsu%7Csgn-BE-FR%7Csgn-BE-NL%7Csgn-CH-DE)%7C(art-lojban%7Ccel-gaulish%7Cno-bok%7Cno-nyn%7Czh-guoyu%7Czh-hakka%7Czh-min%7Czh-min-nan%7Czh-xiang)))%24)):
+```regex
+^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$
+```
+
+
+
+
+
+
 ## xdm:operatingSystem
 ### Operating system
 
diff --git a/schemas/context/environment.schema.json b/schemas/context/environment.schema.json
index 02391f253..cf962a1b5 100644
--- a/schemas/context/environment.schema.json
+++ b/schemas/context/environment.schema.json
@@ -143,6 +143,16 @@
           "title": "Internet service provider",
           "type": "string",
           "description": "The name of the user's internet service provider."
+        },
+        "xdm:locale": {
+          "title": "Language locale code",
+          "type": "string",
+          "pattern": "^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$",
+          "description": "Language used in the environment. The locale code should follow [RFC BCP 47](https://tools.ietf.org/html/bcp47)",
+          "examples": [
+            "en-US",
+            "de-CH"
+          ]
         }
       }
     }

From 98c392828bbbc2e00925eb8bdaa9cad7ac4339f0 Mon Sep 17 00:00:00 2001
From: Kevin Lind <lind@adobe.com>
Date: Wed, 25 Mar 2020 11:29:22 -0700
Subject: [PATCH 2/2] Use dc:language instead of custom xdm:locale property.
 Representation of locale codes is already provided by the Dublin Core term
 'language' so it should be used here instead of creating a new XDM property.

---
 .../reference/context/environment.schema.json | 10 +++---
 docs/reference/context/environment.schema.md  | 33 ++++++++++++++-----
 schemas/context/environment.schema.json       | 12 ++++---
 3 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/docs/reference/context/environment.schema.json b/docs/reference/context/environment.schema.json
index 475cfd441..826fe1ab3 100644
--- a/docs/reference/context/environment.schema.json
+++ b/docs/reference/context/environment.schema.json
@@ -138,14 +138,16 @@
                     "type": "string",
                     "description": "The name of the user's internet service provider."
                 },
-                "xdm:locale": {
-                    "title": "Language locale code",
+                "dc:language": {
+                    "meta:usereditable": false,
+                    "title": "Language",
                     "type": "string",
                     "pattern": "^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$",
-                    "description": "Language used in the environment. The locale code should follow [RFC BCP 47](https://tools.ietf.org/html/bcp47)",
+                    "description": "The language of the environment to represent the user's linguistic, geographical, or cultural preferences for data presentation.\nLanguages are specified in language code as defined in [IETF RFC 3066](https://www.ietf.org/rfc/rfc3066.txt), which is part of BCP 47, which is used elsewhere in XDM.",
                     "examples": [
                         "en-US",
-                        "de-CH"
+                        "pt-BR",
+                        "es-ES"
                     ]
                 }
             }
diff --git a/docs/reference/context/environment.schema.md b/docs/reference/context/environment.schema.md
index 74efb0b1b..249bc2e37 100644
--- a/docs/reference/context/environment.schema.md
+++ b/docs/reference/context/environment.schema.md
@@ -39,7 +39,7 @@ Information about the surrounding situation the event observation occurred, spec
   "xdm:connectionType": "cable",
   "xdm:domain": "verizon.com",
   "xdm:ISP": "Verizon",
-  "xdm:locale": "en-US"
+  "dc:language": "en-US"
 }
 ```
 
@@ -55,7 +55,7 @@ Information about the surrounding situation the event observation occurred, spec
 | [xdm:domain](#xdmdomain) | `string` | Optional | Environment (this schema) |
 | [xdm:ipV4](#xdmipv4) | `string` | Optional | Environment (this schema) |
 | [xdm:ipV6](#xdmipv6) | `string` | Optional | Environment (this schema) |
-| [xdm:locale](#xdmlocale) | `string` | Optional | Environment (this schema) |
+| [dc:language](#dclanguage) | `string` | Optional | Environment (this schema) |
 | [xdm:operatingSystem](#xdmoperatingsystem) | `string` | Optional | Environment (this schema) |
 | [xdm:operatingSystemVendor](#xdmoperatingsystemvendor) | `string` | Optional | Environment (this schema) |
 | [xdm:operatingSystemVersion](#xdmoperatingsystemversion) | `string` | Optional | Environment (this schema) |
@@ -242,21 +242,30 @@ The numerical label assigned to a device participating in a computer network tha
 
 
 
-## xdm:locale
-### Language locale code
+### dc:format Example
 
-The language used in the environment. 
+```json
+"application/vnd.adobe.photoshop"
+```
+
+
+## dc:language
+### Language
 
-`xdm:locale`
+The language of the environment to represent the user's linguistic, geographical, or cultural preferences for data presentation.
+Languages are specified in language code as defined in [IETF RFC 3066](https://www.ietf.org/rfc/rfc3066.txt), which is part of BCP 47, which is used elsewhere in XDM.
+
+`dc:language`
 * is optional
 * type: `string`
+
 * defined in this schema
 
-### xdm:locale Type
+### dc:language Type
 
 
 `string`
-* format: `locale` - Locales are expressed following [RFC BCP47](https://tools.ietf.org/html/bcp47)
+
 
 All instances must conform to this regular expression 
 (test examples [here](https://regexr.com/?expression=%5E((((%5BA-Za-z%5D%7B2%2C3%7D(-(%5BA-Za-z%5D%7B3%7D(-%5BA-Za-z%5D%7B3%7D)%7B0%2C2%7D))%3F)%7C%5BA-Za-z%5D%7B4%7D%7C%5BA-Za-z%5D%7B5%2C8%7D)(-(%5BA-Za-z%5D%7B4%7D))%3F(-(%5BA-Za-z%5D%7B2%7D%7C%5B0-9%5D%7B3%7D))%3F(-(%5BA-Za-z0-9%5D%7B5%2C8%7D%7C%5B0-9%5D%5BA-Za-z0-9%5D%7B3%7D))*(-(%5B0-9A-WY-Za-wy-z%5D(-%5BA-Za-z0-9%5D%7B2%2C8%7D)%2B))*(-(x(-%5BA-Za-z0-9%5D%7B1%2C8%7D)%2B))%3F)%7C(x(-%5BA-Za-z0-9%5D%7B1%2C8%7D)%2B)%7C((en-GB-oed%7Ci-ami%7Ci-bnn%7Ci-default%7Ci-enochian%7Ci-hak%7Ci-klingon%7Ci-lux%7Ci-mingo%7Ci-navajo%7Ci-pwn%7Ci-tao%7Ci-tay%7Ci-tsu%7Csgn-BE-FR%7Csgn-BE-NL%7Csgn-CH-DE)%7C(art-lojban%7Ccel-gaulish%7Cno-bok%7Cno-nyn%7Czh-guoyu%7Czh-hakka%7Czh-min%7Czh-min-nan%7Czh-xiang)))%24)):
@@ -266,6 +275,14 @@ All instances must conform to this regular expression
 
 
 
+### dc:language Example
+
+```json
+"en-US"
+```
+
+
+
 
 
 
diff --git a/schemas/context/environment.schema.json b/schemas/context/environment.schema.json
index cf962a1b5..d27327044 100644
--- a/schemas/context/environment.schema.json
+++ b/schemas/context/environment.schema.json
@@ -144,14 +144,16 @@
           "type": "string",
           "description": "The name of the user's internet service provider."
         },
-        "xdm:locale": {
-          "title": "Language locale code",
+        "dc:language": {
+          "meta:usereditable": false,
+          "title": "Language",
           "type": "string",
           "pattern": "^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$",
-          "description": "Language used in the environment. The locale code should follow [RFC BCP 47](https://tools.ietf.org/html/bcp47)",
+          "description": "The language of the environment to represent the user's linguistic, geographical, or cultural preferences for data presentation.\nLanguages are specified in language code as defined in [IETF RFC 3066](https://www.ietf.org/rfc/rfc3066.txt), which is part of BCP 47, which is used elsewhere in XDM.",
           "examples": [
-            "en-US",
-            "de-CH"
+              "en-US",
+              "pt-BR",
+              "es-ES"
           ]
         }
       }