New translations attributes (#1203)
This commit is contained in:
parent
94aa9f71a7
commit
0ca2155229
|
@ -10,25 +10,81 @@ aliases: [
|
|||
]
|
||||
---
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
|
||||
Translation of status with content warning and media
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "<p>Hola mundo</p>",
|
||||
"detected_source_language": "en",
|
||||
"content": "<p>Hello world</p>",
|
||||
"spoiler_text": "Greatings ahead",
|
||||
"media_attachments": [
|
||||
{
|
||||
"id": 22345792,
|
||||
"description": "Status author waving at the camera"
|
||||
}
|
||||
],
|
||||
"poll": null,
|
||||
"detected_source_language": "es",
|
||||
"provider": "DeepL.com"
|
||||
}
|
||||
```
|
||||
|
||||
Translation of status with poll:
|
||||
```json
|
||||
{
|
||||
"content": "<p>Should I stay or should I go?</p>",
|
||||
"spoiler_text": "",
|
||||
"media_attachments": [],
|
||||
"poll": [
|
||||
{
|
||||
"id": 34858,
|
||||
"options": [
|
||||
{
|
||||
"title": "Stay"
|
||||
},
|
||||
{
|
||||
"title": "Go"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"detected_source_language": "ja",
|
||||
"provider": "DeepL.com"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
### `content` {#content}
|
||||
|
||||
**Description:** The translated text of the status.\
|
||||
**Description:** HTML-encoded translated content of the status.\
|
||||
**Type:** String (HTML)\
|
||||
**Version history:**\
|
||||
4.0.0 - added
|
||||
|
||||
### `spoiler_warning` {#spoiler_warning}
|
||||
|
||||
**Description:** The translated spoiler warning of the status.\
|
||||
**Type:** String\
|
||||
**Version history:**\
|
||||
4.2.0 - added
|
||||
|
||||
### `poll` {#poll}
|
||||
|
||||
**Description:** The translated poll options of the status.\
|
||||
**Type:** Array\
|
||||
**Version history:**\
|
||||
4.2.0 - added
|
||||
|
||||
### `media_attachments` {#media_attachments}
|
||||
|
||||
**Description:** The translated media descriptions of the status.\
|
||||
**Type:** Array\
|
||||
**Version history:**\
|
||||
4.2.0 - added
|
||||
|
||||
### `detected_source_language` {#detected_source_language}
|
||||
|
||||
**Description:** The language of the source text, as auto-detected by the machine translation provider.\
|
||||
|
|
|
@ -558,12 +558,45 @@ Authorization
|
|||
#### Response
|
||||
##### 200: OK
|
||||
|
||||
Translating the first "Hello world" post from mastodon.social into Spanish
|
||||
Translating a status in Spanish with content warning and media into English
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "<p>Hola mundo</p>",
|
||||
"detected_source_language": "en",
|
||||
"content": "<p>Hello world</p>",
|
||||
"spoiler_text": "Greatings ahead",
|
||||
"media_attachments": [
|
||||
{
|
||||
"id": 22345792,
|
||||
"description": "Status author waving at the camera"
|
||||
}
|
||||
],
|
||||
"poll": null,
|
||||
"detected_source_language": "es",
|
||||
"provider": "DeepL.com"
|
||||
}
|
||||
```
|
||||
|
||||
Translating a status with poll into English
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "<p>Should I stay or should I go?</p>",
|
||||
"spoiler_text": null,
|
||||
"media_attachments": [],
|
||||
"poll": [
|
||||
{
|
||||
"id": 34858,
|
||||
"options": [
|
||||
{
|
||||
"title": "Stay"
|
||||
},
|
||||
{
|
||||
"title": "Go"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"detected_source_language": "ja",
|
||||
"provider": "DeepL.com"
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue