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

4 commits

Author SHA1 Message Date
ilja
d5b3d9104d Code review
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
* Add Changelog and description.exs
* Also cleaned up some code that was left behind when still poking at things a bit
2022-12-17 17:18:36 +01:00
ilja
d1bb480146 Change ArgosTranslate strategy for dealing with nil from-language
Instead of choosing a fallback language, we just return the input, supposedly translated from the target language.
This gives us a much faster response, so you can immedialty choose the correct from language yourself in pleroma-fe.

Some other cleanup and improvements to the docs are also done.
2022-12-17 13:34:03 +01:00
ilja
f78bada08d Allow stripping of html for Argos Translate module
Argos Translate doesn't properly translate HTML.
Libre Translate uses an extra module for that.
Here we strip the HTML by default before translating and then add rudimentary HTML back so it displays properly.

Stripping HTML is a default-on option, just in case argos adds support for html in the language models later on.
That way admins will be able to overwrite the setting and not strip any more.
2022-12-17 13:34:03 +01:00
ilja
f027db9654 Add translation module for Argos Translate
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 irectly from our server without doing requests to a third party or
having to install our own LibreTranslate webservice.

One thing that's currently still missing from ArgosTranslate is auto-detection of languages.
2022-12-17 13:34:03 +01:00