Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nikclayton opened this issue Jul 6, 2023 · 2 comments
Open
Assignees
Labels
API The Mastodon core API

Comments

@nikclayton
Copy link
Contributor

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

  • content
  • detected_source_language
  • provider

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

@nikclayton
Copy link
Contributor Author

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=\" 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=\" noopener noreferrer\" target=\"_blank\">@<span>nikclayton</span></a></span></p>",
    "poll": null,
    "media_attachments": [
        {
            "id": "111325487027294122",
            "description": "A description of the test image"
        }
    ]
}

@andypiper andypiper added the API The Mastodon core API label Jan 13, 2024
@andypiper andypiper self-assigned this Jan 13, 2024
@technicat
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API The Mastodon core API
Projects
None yet
Development

No branches or pull requests

3 participants