decentralized-identity / decentralized-identity/didcomm-messaging
Use maps instead triples for l10n inline strategy
- Dominant language
- JavaScript
- Stars
- 193
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
I'm wondering if there's a particular reason why triples are preferred for the `l10n` extension in the `inline` strategy. Why not resort to maps for less duplication and simpler translation JSON - data structure translation (as I suspect the triples would get translated to maps anyway).
So currently there's:
```json
{
"id": "388d599a-fdc1-4890-b32a-be6cd3893564",
"type": "https://didcomm.org/chess/1.0/move",
"lang": "en",
"l10n": {
"inline": [
["fr", "comment", "C'est échec et mat, mon pote."],
["es", "comment", "Eso es jaque mate, amigo"]
]
},
"body": {
"move": "BC4+",
"comment": "That's checkmate, buddy."
}
}
```
With maps:
```json
{
"id": "388d599a-fdc1-4890-b32a-be6cd3893564",
"type": "https://didcomm.org/chess/1.0/move",
"lang": "en",
"l10n": {
"inline": {
"fr": {
"comment": "C'est échec et mat, mon pote."
},
"es": {
"comment": "Eso es jaque mate, amigo"
}
}
},
"body": {
"move": "BC4+",
"comment": "That's checkmate, buddy."
}
}
```
Reading this as a human, it looks more convoluted for just one field being localized, but for more it ends up a bit more compact.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.