mastodon / documentation

Mastodon documentation
https://docs.joinmastodon.org
GNU Free Documentation License v1.3
1.7k stars 975 forks source link

https://docs.joinmastodon.org/entities/Translation/ is incomplete #1248

Open nikclayton opened 1 year ago

nikclayton commented 1 year ago

https://docs.joinmastodon.org/entities/Translation/ describes the following attributes in the response.

According to implementation on mastodon.social at the time of writing (4.1.3+nightly-20230706) there is also:

nikclayton commented 10 months ago

Note re poll -- it doesn't contain the full poll metadata, only the titles and the poll ID.

This is a translated poll where the original post had no content warning.

{
    "detected_source_language": "fr",
    "language": "en",
    "provider": "DeepL.com",
    "spoiler_text": "",
    "content": "<p><span class=\"h-card\"><a href=\"https://mastodon.social/@nikclayton\" class=\"u-url mention\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">@<span>nikclayton</span></a></span></p>",
    "poll": {
        "id": "649249",
        "options": [
            {
                "title": "A"
            },
            {
                "title": "Two"
            },
            {
                "title": "Three"
            },
            {
                "title": "Four"
            }
        ]
    },
    "media_attachments": []
}

This is a translated status with a content warning, body text, and one image with a media description:

{
    "detected_source_language": "fr",
    "language": "en",
    "provider": "DeepL.com",
    "spoiler_text": "A test warning",
    "content": "<p>A test station</p><p><span class=\"h-card\"><a href=\"https://mastodon.social/@nikclayton\" class=\"u-url mention\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">@<span>nikclayton</span></a></span></p>",
    "poll": null,
    "media_attachments": [
        {
            "id": "111325487027294122",
            "description": "A description of the test image"
        }
    ]
}
technicat commented 7 months ago

The doc for Translation does list a spoiler_warning attribute which is not returned as far as I can tell. I believe that is supposed to be spoiler_text.