Documentación

La documentación para desarrolladores está en inglés.

Tipo de tarjeta

translation

A phrase in another language, with transliteration and alternatives.

Version 1 · schema translation.v1.schema.json

Layouts

Every card type has full. Pick a layout with the element's layout attribute, render.layout, or a theme.

Fields

The fields of card.data. Values a source doesn't provide are null; new optional fields can appear within version 1.

FieldTypeRequiredNotes
fromobjectyes
from.langlanguage tagyesBCP 47 language tag.
from.textstringyes
toobjectyes
to.langlanguage tagyesBCP 47 language tag.
to.textstringyes
to.transliterationstring | nullLatin-script reading for non-Latin scripts.
alternatives[]object[]yes
alternatives[].textstringyes
alternatives[].transliterationstring | null
alternatives[].notestring | nullWhen to use it, in the answer locale.

Example

A recorded answer to “How do you say thank you in Japanese?”. Open it in the Answer Lab to see every layout and style.

Response
{
  "v": 2,
  "id": "ans_iqftl2jx34bo2czb",
  "matched": true,
  "locale": "en",
  "skill": "translate",
  "confidence": 0.9,
  "text": "thank you in Japanese: ありがとう",
  "speech": "thank you in Japanese: Arigatō",
  "card": {
    "type": "translation",
    "version": 1,
    "data": {
      "from": {
        "lang": "en",
        "text": "thank you"
      },
      "to": {
        "lang": "ja",
        "text": "ありがとう",
        "transliteration": "Arigatō"
      },
      "alternatives": []
    }
  },
  "sources": [],
  "follow_ups": [],
  "actions": [],
  "usage": {
    "billable": true
  }
}