Skip to content

Get translations ​

Last updated View as Markdown

Endpoint: https://api.youcan.shop/translations/{type}/{id}

Method: GET

Required Scopes ​

  • read-languages

Notes ​

  • content lists each translatable key of the item with its text in the default language and the digest of that text.
  • translations lists the keys that are translated into locale.
  • outdated is true when the text in the default language changed after the translation was saved.
  • You send the key and digest back when you register translations.

Parameters ​

Param NameParam TypeDescriptionRequired
typestringA translatable typeYes
idstringThe id of an item from the listingYes
localestringThe locale of a language from the listingYes

Response ​

[200] Ok

json
{
  "id": "0b6f1e1e-2f8e-4d7f-9a7d-3f8d3c2a1b00",
  "type": "product",
  "locale": "fr",
  "content": [
    {
      "key": "product:0b6f1e1e-2f8e-4d7f-9a7d-3f8d3c2a1b00:name",
      "value": "Wooden chair",
      "digest": "db61a6907bae51b4e609601c661059f387cabab57358d3a3f94197bdbfe19e43"
    },
    {
      "key": "product:0b6f1e1e-2f8e-4d7f-9a7d-3f8d3c2a1b00:description",
      "value": "<p>Solid oak.</p>",
      "digest": "9d86477bf6bf82bb584f0b869ce2da86a7473ff2896a6b0a13c65ea69888cd12"
    }
  ],
  "translations": [
    {
      "key": "product:0b6f1e1e-2f8e-4d7f-9a7d-3f8d3c2a1b00:name",
      "value": "Chaise en bois",
      "outdated": false
    }
  ]
}