Support all JSON-LD translation data models
The store should be able to understand all these data models (spec here):
// 1 - set default language
{
"@context": {
"@language": "ja"
},
"name": "花澄",
"occupation": "科学者"
}
// 2 - set one language to property
{
"@context": {
"ex": "http://example.com/vocab/",
"@language": "ja",
"occupation": { "@id": "ex:occupation" },
"occupation_en": { "@id": "ex:occupation", "@language": "en" },
},
"occupation": "忍者",
"occupation_en": "Ninja",
}
// 3 - clear default language
{
"@context": {
...
"@language": "ja"
},
"name": "花澄",
"details": {
"@context": {
"@language": null
},
"occupation": "Ninja"
}
}
// 4 - containers of languages
{
"@context": {
...
"occupation": { "@id": "ex:occupation", "@container": "@language" }
},
"name": "Yagyū Muneyoshi",
"occupation": {
"ja": "忍者",
"en": "Ninja",
"cs": "Nindža"
}
...
}
// 5 - expanded values
{
"@context": {
...
"@language": "ja"
},
"name": "花澄",
"occupation": {
"@value": "Scientist",
"@language": "en"
}
}
It seems important to look if LDFlex will be replacing our store first, as it seems to support i18n already: https://github.com/LDflex/LDflex/issues/47