Inline translation on toots #15

Open
opened 2022-11-17 17:19:53 +00:00 by eureka · 1 comment

I know it's going to be a bit difficult to implement, but having an easily accessible 'Translate toot' button is a very useful feature, and I've seen a handful of toots mention it recently.

To avoid using up API credits doing translations for every single post, we should probably just detect the language used in the toot and store it. If the tagged language differs from the user's locally configured language, show a translate link at the bottom of the tootl.

Google has a language detection extension to their translation api:
https://cloud.google.com/translate/docs/basic/detecting-language

Presumably Bing and other common translation APIs also offer the same. Alternatively, we can also do the same (to a much less reliable extent) by tokenizing the toot and comparing against lists of the most frequent words of each (supported) language (maybe against an existing simple list, like what's in /usr/share/dict). This can probably be done at toot ingest time and stored along with the toot.

I know it's going to be a bit difficult to implement, but having an easily accessible 'Translate toot' button is a very useful feature, and I've seen a handful of toots mention it recently. To avoid using up API credits doing translations for every single post, we should probably just detect the language used in the toot and store it. If the tagged language differs from the user's locally configured language, show a translate link at the bottom of the tootl. Google has a language detection extension to their translation api: https://cloud.google.com/translate/docs/basic/detecting-language Presumably Bing and other common translation APIs also offer the same. Alternatively, we can also do the same (to a much less reliable extent) by tokenizing the toot and comparing against lists of the most frequent words of each (supported) language (maybe against an existing simple list, like what's in /usr/share/dict). This can probably be done at toot ingest time and stored along with the toot.
kouhai added the
priority/3.low
area/infrastructure
labels 2022-11-20 06:13:30 +00:00
https://github.com/glitch-soc/mastodon/issues/1865 o.o
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: treehouse/mastodon#15
There is no content yet.