Tradução automática¶
Suporte integrado para vários serviços de tradução automática e pode ser ativado pelo administrador a usar MT_SERVICES
para cada um. Eles estão sujeitos aos seus termos de uso, portanto, certifique-se de ter permissão para usá-los como desejar.
O idioma fonte pode ser configurado na Configuração de projeto.
amaGama¶
Instalação especial do tmserver executado pelos autores do Virtaal.
Ative este serviço a adicionar weblate.machinery.tmserver.AmagamaTranslation
a MT_SERVICES
.
Veja também
Apertium¶
Uma plataforma de tradução de máquina de software livre que fornece traduções para um conjunto limitado de idiomas.
A maneira recomendada de usar o Apertium é executar o seu próprio servidor Apertium-APy.
Ative este serviço a adicionar weblate.machinery.apertium.ApertiumAPYTranslation
a MT_SERVICES
e defina MT_APERTIUM_APY
.
Veja também
MT_APERTIUM_APY
, Site do Apertium, Documentação do Apertium APy
AWS¶
Novo na versão 3.1.
O Amazon Translate é um serviço de tradução de máquina neural para traduzir textos de e para o inglês numa variedade de idiomas compatíveis.
Turn on this service by adding
weblate.machinery.aws.AWSTranslation
toMT_SERVICES
.Instale o módulo boto3.
Configure o Weblate.
Tradução de máquina do Baidu API¶
Novo na versão 3.2.
Serviço de tradução de máquina fornecido pelo Baidu.
Este serviço usa uma API e precisa obter um ID e uma chave de API do Baidu para usá-lo.
Ative este serviço a adicionar weblate.machinery.baidu.BaiduTranslation
a MT_SERVICES
e defina MT_BAIDU_ID
e MT_BAIDU_SECRET
.
Veja também
DeepL¶
Novo na versão 2.20.
DeepL é um serviço pago que fornece boa tradução de máquina para alguns idiomas. Precisa comprar a assinatura do DeepL API ou pode usar o plano legado :guilabel:`DeepL Pro (classic) `.
Ative este serviço a adicionar weblate.machinery.deepl.DeepLTranslation
a MT_SERVICES
e definda MT_DEEPL_KEY
.
Dica
In case you have subscription for CAT tools, you are supposed to use «v1
API» instead of default «v2» used by Weblate (it is not really an API
version in this case).
In case you are on a free instead of a paid plan, you have to use
https://api-free.deepl.com/
instead of https://api.deepl.com/
You can adjust both parameters by MT_DEEPL_API_URL
.
Veja também
MT_DEEPL_KEY
,
MT_DEEPL_API_URL
,
DeepL website,
DeepL pricing,
DeepL API documentation
LibreTranslate¶
Novo na versão 4.7.1.
LibreTranslate is a free and open-source service for machine translations. The public instance requires an API key, but LibreTranslate can be self-hosted and there are several mirrors available to use the API for free.
Turn on this service by adding weblate.machinery.libretranslate.LibreTranslateTranslation
to MT_SERVICES
and set MT_LIBRETRANSLATE_API_URL
. If your
instance requires an API key, you must also set MT_LIBRETRANSLATE_KEY
.
Glosbe¶
Dicionário gratuito e memória de tradução para quase todos os idiomas vivos.
O uso da API é gratuito, mas está sujeito à licença da fonte de dados usada. Existe um limite de chamadas que podem ser feitas de um IP num determinado período de tempo, para evitar abusos.
Ative este serviço a adicionar weblate.machinery.glosbe.GlosbeTranslation
a MT_SERVICES
.
Veja também
Google Tradutor¶
Serviço de tradução de máquina fornecido pelo Google.
Este serviço usa a API do Google Tradutor e precisa obter uma chave de API e ativar a cobrança no console da API do Google.
Para ativar este serviço, adicione weblate.machinery.google.GoogleTranslation
em MT_SERVICES
e defina MT_GOOGLE_KEY
.
Veja também
API V3 do Google Tradutor (Avançado)¶
Serviço de tradução de máquina fornecido pelos serviços do Google Cloud.
Este serviço difere do anterior na forma como autentica. Para ativar o serviço, adicione weblate.machinery.googlev3.GoogleV3Translation
para MT_SERVICES
e defina
Se location falhar, também pode precisar especificar MT_GOOGLE_LOCATION
.
Tradutor dos Serviços Cognitivos da Microsoft¶
Novo na versão 2.10.
Serviço de tradução de máquina fornecido pela Microsoft no portal do Azure como um dos Serviços Cognitivos.
Weblate implementa API V3 do Tradutor.
Para ativar este serviço, adicione weblate.machinery.microsoft.MicrosoftCognitiveTranslation
a MT_SERVICES
e defina MT_MICROSOFT_COGNITIVE_KEY
.
API V2 de texto do Tradutor¶
A chave que usa com a API V2 do Tradutor pode ser usada com API 3.
API V3 de texto do Tradutor¶
Precisa registar-se no portal do Azure e usar a chave obtida lá. Com as novas chaves do Azure, também precisa definir MT_MICROSOFT_REGION
para a localidade do seu serviço.
Serviço de Terminologia Microsoft¶
Novo na versão 2.19.
A API do Serviço de Terminologia Microsoft permite que acesse programaticamente a terminologia, as definições e os textos da interface do utilizador (UI) disponíveis no Portal de Idiomas por meio de um serviço da web.
Ative este serviço adicionando weblate.machinery.microsoftterminology.MicrosoftTerminologyService
a MT_SERVICES
.
Veja também
ModernMT¶
Novo na versão 4.2.
Ligue este serviço adicionando weblate.machinery.modernmt.ModernMTTranslation
para MT_SERVICES
e configure MT_MODERNMT_KEY
.
Veja também
MyMemory¶
Grande memória de tradução com tradução de máquina.
O uso gratuito e anônimo está atualmente limitado a 100 solicitações/dia ou a 1000 solicitações/dia quando fornece um endereço de e-mail de contato em MT_MYMEMORY_EMAIL
. Também pode pedir mais.
Ative este serviço adicionando weblate.machinery.mymemory.MyMemoryTranslation
em MT_SERVICES
e defina MT_MYMEMORY_EMAIL
.
Veja também
MT_MYMEMORY_EMAIL
, MT_MYMEMORY_USER
, MT_MYMEMORY_KEY
, site do MyMemory
NetEase Sight API machine translation¶
Novo na versão 3.3.
Machine translation service provided by NetEase.
This service uses an API, and you need to obtain key and secret from NetEase.
Turn on this service by adding weblate.machinery.youdao.NeteaseSightTranslation
to
MT_SERVICES
and set MT_NETEASE_KEY
and
MT_NETEASE_SECRET
.
tmserver¶
You can run your own translation memory server by using the one bundled with Translate-toolkit and let Weblate talk to it. You can also use it with an amaGama server, which is an enhanced version of tmserver.
First you will want to import some data to the translation memory:
2. Turn on this service by adding weblate.machinery.tmserver.TMServerTranslation
to
MT_SERVICES
.
build_tmdb -d /var/lib/tm/db -s en -t cs locale/cs/LC_MESSAGES/django.po
build_tmdb -d /var/lib/tm/db -s en -t de locale/de/LC_MESSAGES/django.po
build_tmdb -d /var/lib/tm/db -s en -t fr locale/fr/LC_MESSAGES/django.po
Start tmserver to listen to your requests:
tmserver -d /var/lib/tm/db
Configure Weblate to talk to it:
MT_TMSERVER = "http://localhost:8888/tmserver/"
Veja também
MT_TMSERVER
,
tmserver
Installing amaGama,
Amagama,
Amagama Translation Memory
Yandex Translate¶
Machine translation service provided by Yandex.
This service uses a Translation API, and you need to obtain an API key from Yandex.
Turn on this service by adding weblate.machinery.yandex.YandexTranslation
to
MT_SERVICES
, and set MT_YANDEX_KEY
.
Veja também
MT_YANDEX_KEY
,
Yandex Translate API,
Powered by Yandex.Translate
Youdao Zhiyun API machine translation¶
Novo na versão 3.2.
Machine translation service provided by Youdao.
This service uses an API, and you need to obtain an ID and an API key from Youdao.
Turn on this service by adding weblate.machinery.youdao.YoudaoTranslation
to
MT_SERVICES
and set MT_YOUDAO_ID
and
MT_YOUDAO_SECRET
.
Weblate¶
Weblate can be the source of machine translations as well. It is based on the Woosh fulltext engine, and provides both exact and inexact matches.
Turn on these services by adding weblate.machinery.weblatetm.WeblateTranslation
to
MT_SERVICES
.
Weblate Translation Memory¶
Novo na versão 2.20.
The Memória de Tradução can be used as a source for machine translation suggestions as well.
Turn on these services by adding weblate.memory.machine.WeblateMemory
to
the MT_SERVICES
. This service is turned on by
default.
SAP Translation Hub¶
Machine translation service provided by SAP.
You need to have a SAP account (and the SAP Translation Hub enabled in the SAP Cloud Platform) to use this service.
Turn on this service by adding weblate.machinery.saptranslationhub.SAPTranslationHub
to
MT_SERVICES
and set the appropriate access to either the
sandbox or the production API.
Nota
To access the Sandbox API, you need to set MT_SAP_BASE_URL
and MT_SAP_SANDBOX_APIKEY
.
To access the productive API, you need to set MT_SAP_BASE_URL
,
MT_SAP_USERNAME
and MT_SAP_PASSWORD
.
Custom machine translation¶
You can also implement your own machine translation services using a few lines of
Python code. This example implements machine translation in a fixed list of
languages using dictionary
Python module:
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
"""Machine translation example."""
import dictionary
from weblate.machinery.base import MachineTranslation
class SampleTranslation(MachineTranslation):
"""Sample machine translation interface."""
name = "Sample"
def download_languages(self):
"""Return list of languages your machine translation supports."""
return {"cs"}
def download_translations(
self,
source,
language,
text: str,
unit,
user,
search: bool,
threshold: int = 75,
):
"""Return tuple with translations."""
for t in dictionary.translate(text):
yield {"text": t, "quality": 100, "service": self.name, "source": text}
You can list your own class in MT_SERVICES
and Weblate
will start using that.