diff --git a/content/en/entities/Translation.md b/content/en/entities/Translation.md index 67d0c475..0b664c1c 100644 --- a/content/en/entities/Translation.md +++ b/content/en/entities/Translation.md @@ -10,25 +10,81 @@ aliases: [ ] --- -## Example +## Examples + +Translation of status with content warning and media ```json { - "content": "

Hola mundo

", - "detected_source_language": "en", + "content": "

Hello world

", + "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": "

Should I stay or should I go?

", + "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.\ diff --git a/content/en/methods/statuses.md b/content/en/methods/statuses.md index 3fc2e88c..64dcf1d7 100644 --- a/content/en/methods/statuses.md +++ b/content/en/methods/statuses.md @@ -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": "

Hola mundo

", - "detected_source_language": "en", + "content": "

Hello world

", + "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": "

Should I stay or should I go?

", + "spoiler_text": null, + "media_attachments": [], + "poll": [ + { + "id": 34858, + "options": [ + { + "title": "Stay" + }, + { + "title": "Go" + } + ] + } + ], + "detected_source_language": "ja", "provider": "DeepL.com" } ```