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

Mastodon "translate" feature does not work on image captions #24012

Closed
mcclure opened this issue Mar 6, 2023 · 4 comments
Closed

Mastodon "translate" feature does not work on image captions #24012

mcclure opened this issue Mar 6, 2023 · 4 comments
Labels
suggestion Feature suggestion

Comments

@mcclure
Copy link

mcclure commented Mar 6, 2023

Pitch

Consider this post:

https://mastodon.social/@NuOpRadio2@mastodon.nl/109978313750597984

It's in Dutch. It has an image attachment with a caption; the post is a little hard to understand without having either context or the descriptive text in the image caption.

I can click "Translate" and it translates the text to English. But if I mouse over the image attachment, it remains in Dutch.

Motivation

If a user wants to read the post text translated it stands to reason they'd want the image captions translated, especially if they are nonsighted.

@mcclure mcclure added the suggestion Feature suggestion label Mar 6, 2023
@mcclure
Copy link
Author

mcclure commented Mar 6, 2023

It looks like this

DSC_0001_BURST20230306160454537_COVER~2

@mrfoogles
Copy link

This sounds like a good idea: trying to read german servers and so on the translate button is very useful, especially if you want to try to read some and translate others.

Special case, that might be added:

  • For image-only posts, maybe the "translate with deepL" button should say "translate caption with deepL" instead, for clarity. I don't know if there are many posts with english text and dutch captions, but this would also work with them.

@mrfoogles
Copy link

For anyone trying to do this, I looked at the code, and I think you'd have to modify:

  • The "/api/v1/statuses/{id}/translate" endpoint to return the caption translation
  • The code to create the data structure for status that is stored in the Redux state (the one that Status and StatusContent use in their props): the translatable field would have to be updated to be set to "yes" if even the alt-text for the image was translatable.
  • The MediaGallery and Video classes to take translations for their "alt", or caption, fields
  • The Status class to pass the translations to them.

@renchap
Copy link
Sponsor Member

renchap commented May 31, 2023

Fixed in #24175

@renchap renchap closed this as completed May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Feature suggestion
Projects
None yet
Development

No branches or pull requests

3 participants