decentralized-identity/didcomm-messaging

Use maps instead triples for l10n inline strategy

bobozaur opened this issue · 0 comments

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:

{
  "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:

{
  "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.