{"action":"created","issue":{"url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/53","repository_url":"https://api.github.com/repos/json-schema-org/json-schema-spec","labels_url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/53/comments","events_url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/53/events","html_url":"https://github.com/json-schema-org/json-schema-spec/issues/53","id":177529015,"number":53,"title":"v6 annotation: Multilingual meta data","user":{"login":"handrews","id":2358015,"avatar_url":"https://avatars.githubusercontent.com/u/2358015?v=3","gravatar_id":"","url":"https://api.github.com/users/handrews","html_url":"https://github.com/handrews","followers_url":"https://api.github.com/users/handrews/followers","following_url":"https://api.github.com/users/handrews/following{/other_user}","gists_url":"https://api.github.com/users/handrews/gists{/gist_id}","starred_url":"https://api.github.com/users/handrews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/handrews/subscriptions","organizations_url":"https://api.github.com/users/handrews/orgs","repos_url":"https://api.github.com/users/handrews/repos","events_url":"https://api.github.com/users/handrews/events{/privacy}","received_events_url":"https://api.github.com/users/handrews/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-09-16T21:58:34Z","updated_at":"2016-09-18T21:11:07Z","closed_at":null,"body":"This was originally proposed on the old wiki at https://github.com/json-schema/json-schema/wiki/multilingual-meta-data-(v5-proposal) by @geraintluff with further contributions from @brettz9 and @sonnyp\r\n\r\nThe `translation` alternative discussed at the end of this comment was originally proposed at https://github.com/json-schema/json-schema/wiki/translations-(v5-proposal) by @geraintluff based on an email thread with @fge.\r\n\r\n### Proposed keywords\r\n\r\nThis proposal modifies the existing properties:\r\n\r\n* `title`\r\n* `description`\r\n\r\nThis proposal would also apply to the named enumerations proposed in issue #57 , if that makes it in.\r\n\r\n### Purpose\r\n\r\nThis modification would allow inclusions of multiple translated values for the specified properties.\r\n\r\nCurrently, schemas can only specify meta-data in one language at a time.  Different localisations *may* be requested by the client using the HTTP `Accept-Language` header, but that requires multiple (largely redundant) requests to get multiple localisations, and is only available over HTTP (not when pre-loading schemas, for instance).\r\n\r\n### Values\r\n\r\nIn addition to the current string values (which are presumed to be in the language of the document), the values of these keywords may be an object.\r\n\r\nThe keys of such an object should be IETF Language Tags, and the values must be strings.\r\n\r\n### Behaviour\r\n\r\nWhen the value of the keyword is an object, the most appropriate language tag should be selected by the client, and the string value used as the value of the keyword.\r\n\r\n### Example\r\n\r\n```json\r\n{\r\n    \"title\": {\r\n        \"en\": \"Example schema\",\r\n        \"de\": \"...\"\r\n    }\r\n}\r\n```\r\n\r\n### Concerns\r\n\r\nSchemas with many languages could end up quite bulky.\r\n\r\nIn fact, the `Accept-Language` option is in many ways more elegant, as the majority of the time only one language will be used by the client (and the other localisations will simply be noise).  However, this option is not available in all situations. One might also avoid the extra bulk by using JSON references (and thereby also enable localisation files to contain all translatable text).\r\n\r\nAn alternative approach to the above would be to reserve `localeKey` as a property for any schema object or sub-object and `localization-strings` as a top-level property:\r\n\r\n```json\r\n{\r\n    \"localization-strings\": {\r\n        \"en\": {\r\n            \"example\": {\r\n                \"title\": \"Example schema\",\r\n                \"description\": \"Example schema description\"\r\n            }\r\n        },\r\n        \"de\": {\r\n            \"example\": {}\r\n        }\r\n    },\r\n    \"type\": \"object\",\r\n    \"localeKey\": \"example\"\r\n}\r\n```\r\n\r\nThe advantage to this approach would be that, as typically occurs with locale files (for reasons of convenience in independent editing by different translators), all language strings could be stored together. Thus, if leveraging JSON references, it would be a simple matter of:\r\n\r\n```json\r\n{\r\n    \"localization-strings\": {\r\n        \"en\": {\r\n            \"$ref\": \"locale_en-US.json\"\r\n        },\r\n        \"de\": {\r\n            \"$ref\": \"locale_de.json\"\r\n        }\r\n    },\r\n    \"type\": \"object\",\r\n    \"localeKey\": \"example\"\r\n}\r\n```\r\n\r\nor yet simpler:\r\n\r\n```json\r\n{\r\n    \"localization-strings\": {\"$ref\": \"locales.json\"},\r\n    \"type\": \"object\",\r\n    \"localeKey\": \"example\"\r\n}\r\n```\r\n\r\n### Alternative: translation objects\r\n\r\nThis alterantive proposes a `translations` keyword which would be alongside the `title` and `descript\r\n\r\n#### translation object Values\r\n\r\nThe value of `translations` would be an object. The values would be a JSON schema meta keyword and would themselves be objects,\r\nwhere each property key MUST be in accordance with [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt)\r\n\r\n#### Example translation object\r\n\r\nWhen translating title and description, you can easily write an object where the meta keywords are RFC3066 conformal:\r\n```json\r\n{\r\n    \"title\": \"postal code\",\r\n    \"description\": \"A postal code.\",\r\n    \"translations\": { \r\n        \"title\": { \r\n            \"en-GB\": \"postcode\",\r\n            \"en-US\": \"zip code\",\r\n            \"de\": \"Postleitzahl\",\r\n            \"fr\": \"code postal\"\r\n        },\r\n        \"description\": {\r\n            \"en-GB\": \"A Royal Mail postcode.\",\r\n            \"en-US\": \"An USPS ZIP code.\",\r\n            //  ...\r\n        }\r\n    }\r\n    //  ...\r\n}\r\n```\r\n\r\n#### Translation object concerns:  where to apply?\r\n\r\n\"What would be left to specify is of course what \"relevant\" is here. \r\nApart from \"title\", there is \"description\". But I don't think we want any other keyword to be affected.\""},"comment":{"url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/comments/247879919","html_url":"https://github.com/json-schema-org/json-schema-spec/issues/53#issuecomment-247879919","issue_url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/53","id":247879919,"user":{"login":"handrews","id":2358015,"avatar_url":"https://avatars.githubusercontent.com/u/2358015?v=3","gravatar_id":"","url":"https://api.github.com/users/handrews","html_url":"https://github.com/handrews","followers_url":"https://api.github.com/users/handrews/followers","following_url":"https://api.github.com/users/handrews/following{/other_user}","gists_url":"https://api.github.com/users/handrews/gists{/gist_id}","starred_url":"https://api.github.com/users/handrews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/handrews/subscriptions","organizations_url":"https://api.github.com/users/handrews/orgs","repos_url":"https://api.github.com/users/handrews/repos","events_url":"https://api.github.com/users/handrews/events{/privacy}","received_events_url":"https://api.github.com/users/handrews/received_events","type":"User","site_admin":false},"created_at":"2016-09-18T21:11:07Z","updated_at":"2016-09-18T21:11:07Z","body":"Note that I just edited the initial comment to include the `translation` alternative, as I've generally been consolidating proposals targeting the same problem into a single issue for discussion."}}
{"actor":{"display_login":"handrews"}}