La documentazione per sviluppatori è in inglese.
Tipo di scheda
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.
| Field | Type | Required | Notes |
|---|---|---|---|
from | object | yes | |
from.lang | language tag | yes | BCP 47 language tag. |
from.text | string | yes | |
to | object | yes | |
to.lang | language tag | yes | BCP 47 language tag. |
to.text | string | yes | |
to.transliteration | string | null | Latin-script reading for non-Latin scripts. | |
alternatives[] | object[] | yes | |
alternatives[].text | string | yes | |
alternatives[].transliteration | string | null | ||
alternatives[].note | string | null | When 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.
{
"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
}
}