Sugerencias automáticas#

Distinto en la versión 4.13: Prior to Weblate 4.13, the services were configured in the Configuración.

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 Automatic suggestions in Interfaz de gestión) or at the project settings:

../_images/project-machinery.webp

Nota

They come subject to their terms of use, so ensure you are allowed to use them how you want.

Los servicios se traducen del idioma de origen según lo configurado en Configuración de componentes, consulte Idioma del código fuente.

Alibaba#

Nuevo en la versión 5.3.

Identificación del servicio:

alibaba

Configuración:

key

Identificador de la clave de acceso

secret

secret de la clave de acceso

region

ID de la región

Alibaba Translate is a neural machine translation service for translating text and it supports up to 214 language pairs.

Amagama#

Identificación del servicio:

amagama

Configuración:

This service has no configuration.

Special installation of tmserver run by the authors of Virtaal.

APy de Apertium#

Identificación del servicio:

apertium-apy

Configuración:

url

URL DE LA APLICACIÓN

A libre software machine translation platform providing translations to a limited set of languages.

The recommended way to use Apertium is to run your own Apertium-APy server.

Amazon Translate#

Identificación del servicio:

aws

Configuración:

key

Identificador de la clave de acceso

secret

Clave secreta de la aplicación

region

Nombre de la región

Amazon Translate is a neural machine translation service for translating text to and from English across a breadth of supported languages.

Baidu#

Identificación del servicio:

baidu

Configuración:

key

Identificación del cliente

secret

Secreto del cliente

Machine translation service provided by Baidu.

This service uses an API and you need to obtain an ID and API key from Baidu to use it.

Ver también

Baidu Translate API

DeepL#

Identificación del servicio:

deepl

Configuración:

url

URL DE LA APLICACIÓN

key

Clave de la aplicación

formality

Formal

Utiliza la formalidad especificada si la lengua no está especificada como (in)formal

DeepL is paid service providing good machine translation for a few languages. You need to purchase DeepL API subscription or you can use legacy DeepL Pro (classic) plan.

API URL to use with the DeepL service. At the time of writing, there is the v1 API as well as a free and a paid version of the v2 API.

https://api.deepl.com/v2/ (default in Weblate)

Is meant for API usage on the paid plan, and the subscription is usage-based.

https://api-free.deepl.com/v2/

Is meant for API usage on the free plan, and the subscription is usage-based.

https://api.deepl.com/v1/

Is meant for CAT tools and is usable with a per-user subscription.

Previously Weblate was classified as a CAT tool by DeepL, so it was supposed to use the v1 API, but now is supposed to use the v2 API. Therefore it defaults to v2, and you can change it to v1 in case you have an existing CAT subscription and want Weblate to use that.

The easiest way to find out which one to use is to open an URL like the following in your browser:

https://api.deepl.com/v2/translate?text=Hello&target_lang=FR&auth_key=XXX

Replace the XXX with your auth_key. If you receive a JSON object which contains «Bonjour», you have the correct URL; if not, try the other three.

Weblate supports DeepL formality, it will choose matching one based on the language (for example, there is de@formal and de@informal).

The service automatically uses Glosario, see Glossaries in automatic suggestion.

Glosbe#

Identificación del servicio:

glosbe

Configuración:

This service has no configuration.

Free dictionary and translation memory for almost every living language.

The API is gratis to use, but usage of the translations is subject to the license of the used data source. There is a limit of calls that may be done from one IP in a set period of time, to prevent abuse.

Ver también

Glosbe website

Google Cloud Translation Basic#

Identificación del servicio:

google-translate

Configuración:

key

Clave de la aplicación

Machine translation service provided by the Google Cloud services.

This service uses the Google Translation API v2, and you need to obtain an API key and turn on billing in the Google API console.

Google Cloud Translation Advanced#

Identificación del servicio:

google-translate-api-v3

Configuración:

credentials

Información de la cuenta del servicio Google Translate

Ingrese una clave JSON para la cuenta de servicio.

project

Proyecto de Google Translate

Ingresa el ID numérico o alfanumérico de tu proyecto de Google Cloud.

location

Ubicación de Google Translate

Elija una región de Google Cloud Translation que se utilice para el proyecto de Google Cloud o que esté más cerca de usted.

Machine translation service provided by the Google Cloud services.

This service uses the Google Translation API v3 and you need credentials in JSON format to access it.

In order to use this service, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.

  2. Enable billing for your project.

  3. Enable the Cloud Translation.

  4. Setup Authentication.

IBM Watson Language Translator#

Nuevo en la versión 4.16.

Identificación del servicio:

ibm

Configuración:

url

URL DE LA APLICACIÓN

key

Clave de la aplicación

Advertencia

This service is deprecated by vendor and will be withdrawn entirely as of 10 December 2024.

IBM Watson Language Translator translates text from one language to another. The service offers multiple domain-specific models.

LibreTranslate#

Nuevo en la versión 4.7.1.

Identificación del servicio:

libretranslate

Configuración:

url

URL DE LA APLICACIÓN

key

Clave de la aplicación

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.

https://libretranslate.com/ (official public instance)

Requires an API key to use outside of the website.

Azure AI Translator#

Identificación del servicio:

microsoft-translator

Configuración:

key

Clave de la aplicación

base_url

La url base de la aplicación

Opciones disponibles:

api.cognitive.microsofttranslator.com – Global (non-regional)

api-apc.cognitive.microsofttranslator.com – Asia Pacific

api-eur.cognitive.microsofttranslator.com – Europe

api-nam.cognitive.microsofttranslator.com – North America

api.translator.azure.cn – China

api.cognitive.microsofttranslator.us – Azure US Government cloud

endpoint_url

URL del servicio de autenticación

Regional o multi-servicio puede ser especificado usando el campo de region a continuación.

Opciones disponibles:

api.cognitive.microsoft.com – Global

api.cognitive.azure.cn – China

api.cognitive.microsoft.us – Azure US Government cloud

region

Región del servicio de autenticación

Machine translation service provided by Microsoft in Azure portal as a one of Cognitive Services.

Weblate implements Translator API V3.

The service automatically uses Glosario, see Glossaries in automatic suggestion.

Translator Text API V2#

The key you use with Translator API V2 can be used with API 3.

Translator Text API V3#

You need to register at Azure portal and use the key you obtain there. With new Azure keys, you also need to set region to locale of your service.

Consejo

For Azure China, please use your endpoint from the Azure Portal.

ModernMT#

Nuevo en la versión 4.2.

Identificación del servicio:

modernmt

Configuración:

url

URL DE LA APLICACIÓN

key

Clave de la aplicación

Ver también

ModernMT API

MyMemory#

Identificación del servicio:

mymemory

Configuración:

email

Email de contacto

username

Nombre de usuario

key

Clave de la aplicación

Enorme memoria de traducción que ofrece traducciones automáticas.

Free, anonymous usage is currently limited to 100 requests/day, or to 1000 requests/day when you provide a contact e-mail address in email. You can also ask them for more.

Ver también

MyMemory website

Netease Sight#

Identificación del servicio:

netease-sight

Configuración:

key

Identificación del cliente

secret

Secreto del cliente

Servicio de traducción automática proporcionado por NetEase.

Este servicio utiliza una API y debe adquirir una clave y secreto de NetEase.

OpenAI#

Nuevo en la versión 5.3.

Identificación del servicio:

openai

Configuración:

key

Clave de la aplicación

model

Modelo OpenAI

Opciones disponibles:

auto – Automatic selection

gpt-4-1106-preview – GPT-4 Turbo

gpt-4 – GPT-4

gpt-3.5-turbo – GPT-3.5 Turbo

persona

Traductor persona

Describe la personalidad del traductor para mejorar la precisión de la traducción. Por ejemplo: «Eres un criador de ardillas.»

style

Estilo de traductor

Describe el estilo de traducción. Por ejemplo: «Utilice un lenguaje informal.»

Performs translation using OpenAI.

The OpenAI API is powered by a diverse set of models with different capabilities and price points. Automatic selection chooses the best model available, but you might want to choose a specific model that matches your needs.

Use persona and style fields to further fine-tune translations. These will be used in a prompt for OpenAI and allow you to change the style of the translations.

The service automatically uses Glosario, see Glossaries in automatic suggestion.

SAP Translation Hub#

Identificación del servicio:

sap-translation-hub

Configuración:

url

URL DE LA APLICACIÓN

key

Clave de la aplicación

username

Nombre de usuario de SAP

password

Contraseña de SAP

enable_mt

Activar la traducción automática

domain

Dominio de la traducción

El ID de un dominio de traducción, por ejemplo, BC. Si no se especifica un dominio, el método busca las traducciones en todos los dominios disponibles.

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.

You can also configure whether to also use machine translation services, in addition to the term database.

Nota

To access the Sandbox API, you need to set url and key.

To access the productive API, you need to set url, username and password.

tmserver#

Identificación del servicio:

tmserver

Configuración:

url

URL DE LA APLICACIÓN

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.

  1. Lo primero que querrá hacer es importar algunos datos en la memoria de traducción:

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
  1. Inicie el tmserver para que escuche sus peticiones:

tmserver -d /var/lib/tm/db
  1. Configure Weblate to talk to it, the default URL is http://localhost:8888/tmserver/.

Weblate#

Identificación del servicio:

weblate

Configuración:

This service has no configuration.

Weblate machine translation service can provide translations for strings that are already translated inside Weblate. It looks for exact matches in the existing strings.

Weblate Translation Memory#

Identificación del servicio:

weblate-translation-memory

Configuración:

This service has no configuration.

Use Memoria de traducción as a machine translation service. Any string that has been translated in past (or uploaded to the translation memory) can be translated in this way.

Yandex#

Identificación del servicio:

yandex

Configuración:

key

Clave de la aplicación

Servicio de traducción automática ofrecido por Yandex.

This service uses a Translation API, and you need to obtain an API key from Yandex.

Yandex v2#

Nuevo en la versión 5.1.

Identificación del servicio:

yandex-v2

Configuración:

key

Clave de la aplicación

Servicio de traducción automática ofrecido por Yandex.

This service uses a Translation API, and you need to obtain an API key from Yandex Cloud.

Youdao Zhiyun#

Identificación del servicio:

youdao-zhiyun

Configuración:

key

Identificación del cliente

secret

Secreto del cliente

El servicio de traducciones automáticas lo brinda Youdao.

Este servicio utiliza una API; habrá de obtener un identificador y una clave de API de Youdao.

Traducción automática personalizada#

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 © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

"""Machine translation example."""

import dictionary  # type: ignore[import-not-found]

from weblate.machinery.base import DownloadTranslations, 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,
        threshold: int = 75,
    ) -> DownloadTranslations:
        """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 WEBLATE_MACHINERY and Weblate will start using that.