Add translation module for Argos Translate #351

Merged
floatingghost merged 4 commits from ilja/akkoma:add_translator_argos_translate into develop 2022-12-19 13:06:39 +00:00
Contributor

Argos Translate is a Python module for translation and can be used as a command line tool.

This is also the engine for LibreTranslate, for which we already have a module.
Here we can use the engine directly from our server without doing requests to a third party or having to install our own LibreTranslate webservice (obviously you do have to install Argos Translate).

One thing that's currently still missing from Argos Translate is auto-detection of languages (see https://github.com/argosopentech/argos-translate/issues/9). For now, when no source language is provided, we just return the text unchanged, supposedly translated from the target language. That way you get a near immediate response in pleroma-fe when clicking Translate, after which you can select the source language from a dropdown.

Argos Translate also doesn't seem to handle html very well. Therefore we give admins the option to strip the html before translating. I made this an option because I'm unsure if/how this will change in the future.

Argos Translate is a Python module for translation and can be used as a command line tool. This is also the engine for LibreTranslate, for which we already have a module. Here we can use the engine directly from our server without doing requests to a third party or having to install our own LibreTranslate webservice (obviously you do have to install Argos Translate). One thing that's currently still missing from Argos Translate is auto-detection of languages (see <https://github.com/argosopentech/argos-translate/issues/9>). For now, when no source language is provided, we just return the text unchanged, supposedly translated from the target language. That way you get a near immediate response in pleroma-fe when clicking Translate, after which you can select the source language from a dropdown. Argos Translate also doesn't seem to handle html very well. Therefore we give admins the option to strip the html before translating. I made this an option because I'm unsure if/how this will change in the future.
ilja changed title from Add translation module for Argos Translate to WIP: Add translation module for Argos Translate 2022-12-09 12:23:27 +00:00
ilja force-pushed add_translator_argos_translate from 6b9bdb3c64 to 6aceeb7220 2022-12-09 12:39:59 +00:00 Compare
ilja changed title from WIP: Add translation module for Argos Translate to Add translation module for Argos Translate 2022-12-09 12:44:18 +00:00

seems to work!

any chance you can update config/description.exs for admin-fe stuff and add a changelog entry?

seems to work! any chance you can update config/description.exs for admin-fe stuff and add a changelog entry?
floatingghost added the
needs docs
label 2022-12-14 10:48:58 +00:00
ilja force-pushed add_translator_argos_translate from 444833fde2 to eee77a1727 2022-12-17 12:36:23 +00:00 Compare
ilja force-pushed add_translator_argos_translate from eee77a1727 to d5b3d9104d 2022-12-17 16:18:49 +00:00 Compare

you've got a linting issue

but i'll fix that, thanks!

you've got a linting issue but i'll fix that, thanks!
floatingghost merged commit c092fc9fd6 into develop 2022-12-19 13:06:39 +00:00
floatingghost deleted branch add_translator_argos_translate 2022-12-19 13:06:39 +00:00
Sign in to join this conversation.
No description provided.