Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use maps instead triples for l10n inline strategy #434

Open
bobozaur opened this issue Mar 7, 2023 · 0 comments
Open

Use maps instead triples for l10n inline strategy #434

bobozaur opened this issue Mar 7, 2023 · 0 comments

Comments

@bobozaur
Copy link

bobozaur commented Mar 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant