expect-digital / translate

Translation for distributed systems
0 stars 0 forks source link

Translation data design #1

Open janishorsts opened 1 year ago

janishorsts commented 1 year ago

Prepare initial data design based on the libraries used by our clients (mainly golang, angular and flutter):

Draft

type Message struct {
  ID        string
  Message   string
  Fuzzy     bool
}

type Messages struct {
  Language string
  Messages []Message
}

Language file definitions

go

text/message

Messages type definition

{
  "language": "en-GB",
  "messages": [
    {
      "id": "Welcome!",
      "message": "Welcome!",
      "translation": "Welcome!",
      "translatorComment": "Copied from source.",
      "fuzzy": true
    }
  ]
}

nicksnyder/go-i18n

nicksnyder/go-i18n

angular

@angular/localize

Extracted values to JSON are very primitive - only key/value. No contextual information (description etc) on the translatable text is available. Do we really want to support it?

{
  "locale": "en-GB",
  "translations": {
    "4606963464835766483": "Welcome!"
  }
}

translation files

ngx-translate

overview

flutter

internationalization

internationalization