weblate/docs/admin/machine.rst
Michal Čihař 0987aa1438 feat(machinery): show warning about sending data to third-party
Make it clear that the manchinery services send data to third-party
service.
2026-05-13 15:57:41 +02:00

97 lines
3.6 KiB
ReStructuredText
Vendored

.. _machine-translation-setup:
Automatic suggestions
=====================
.. versionchanged:: 4.13
Prior to Weblate 4.13, the services were configured in the :ref:`config`.
The support for several machine translation and translation memory services is
built-in. Each service can be turned on by the administrator for whole site
(under :guilabel:`Automatic suggestions` in :ref:`management-interface`) or at
the project settings:
.. image:: /screenshots/project-machinery.webp
.. note::
They come subject to their terms of use, so ensure you are allowed to use
them how you want. Third-party services can receive source strings,
translations, and related context from Weblate.
The services translate from the source language as configured at
:ref:`component`, see :ref:`component-source_language`.
Per-project automatic suggestion can also be configured via the :ref:`api`.
.. seealso::
:ref:`machine-translation`
.. _mt-translation-services-priority:
Priority of machine translation and translation memory services
----------------------------------------------------------------
:ref:`mt-weblate-translation-memory` matches with 100% score take priority over machine translation services. If 100% match in translation memory is found, no machine translation is performed. If several 100% matches occur, the first one returned by the database is used.
Each machine translation service has a predefined maximum score it can produce. The use of installed translation services is ordered according to their maximum score. For each string with translation score lower than the service's maximum, the service is asked to produce a translation. Translations with a score exceeding the current one are accepted.
.. _mt-sources:
Source strings for the machine translation
------------------------------------------
.. versionadded:: 5.11
The origin of source strings for all third-party services can be configured.
This can be used to tweak the service to get the best results. Following choices are available:
:guilabel:`Automatic selection`
Chooses the best source language automatically.
This is the default behavior.
:guilabel:`Component source language`
Uses the component source language.
This was the behavior before the 5.11 release.
:guilabel:`Secondary language defined in project or component`
Use project :ref:`project-secondary_language` or component :ref:`component-secondary_language`.
Falls back to the automatic selection of the source language if the secondary language not configured.
.. _llm-translation-context:
LLM translation context
-----------------------
LLM-based automatic suggestion services receive additional context about each
translated string, when available. This includes the string context or
monolingual key, additional explanation, configured secondary-language
translation, plural information, failing quality checks, and placeholder
contents. The added metadata is used only to guide the generated suggestion;
the returned translation still has to preserve the source placeholders and
markup.
.. include:: /snippets/machines-autogenerated.rst
.. _custom-machinery:
Custom machine translation
--------------------------
You can also implement your own machine translation services using a few lines
of Python code. Place the code in a module Weblate can import (see
:ref:`custom-module` or :ref:`docker-python-override`) and add fully qualified
class name to :setting:`WEBLATE_MACHINERY`.
.. literalinclude:: ../../weblate/examples/mt_service.py
:language: python
.. seealso::
* :ref:`custom-modules`
* :ref:`custom-module`
* :ref:`docker-python-override`