WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.52k stars 1k forks source link

Set priority for Machine translation engines in Automatic Translation Addon. #5770

Open ghost opened 3 years ago

ghost commented 3 years ago

When the Automatic Translation Addon is configured for a component multiple engines can be activated (chosen). In the scenario skiping suggestions and translating all Messages "needing action" right away it would be great to first look them up in the local Translation Memory and in a second step, all other Messages still needing action get a translation from another engine.

Using e.G. deepl and the Weblate Translation Memory there seem to be no way to change the order or priority. I would want to make sure the local Memory is used before the remote API is asked for a translation. If Weblate by dedault considers local Memory at first anyway, this should be visible in the Addon's settings.

A good solution would be drag and drop capability for the list elements and some visible numbers, that indicate priority.

nijel commented 3 years ago

The priorities are currently set in the code, the 100% match from translation memory will always be preferred over machine translation. Having UI to tweak this would be nice.

See also https://github.com/WeblateOrg/weblate/issues/3315

github-actions[bot] commented 3 years ago

This issue has been added to the backlog. It is not scheduled on the Weblate roadmap, but it eventually might be implemented. In case you need this feature soon, please consider helping or push it by funding the development.

nijel commented 1 month ago

Right now the chosen engines are first sorted based on rank (translation memory being first, the machine translation services being ordered by hard-coded score, currently DeepL is the preferred service there):

https://github.com/WeblateOrg/weblate/blob/78f721ef7a2a01514e26b3a0647f96ca95ea66aa/weblate/trans/autotranslate.py#L168-L176

Then the services are tried in order and are used to translate only if they can provide better result. If you get 100% translation memory match, then nothing else will be tried, but if the translation memory match is lower quality, the machine translation will still be performed.