Integración con Weblate

Fundamentos de Weblate

Estructura de los proyectos y los componentes

In Weblate translations are organized into projects and components. Each project can contain number of components and those contain translations into individual languages. The component corresponds to one translatable file (for example gettext de GNU or Recursos de cadenas de Android). The projects are there to help you organize component into logical sets (for example to group all translations used within one application).

Internally, each project has translations to common strings propagated across other components within it by default. This lightens the burden of repetitive and multi version translation. The translation propagation can be disabled per Configuración de componentes using Permitir propagación de traducciones in case the translations should diverge.

Importing localization project into Weblate

Weblate has been developed with VCS integration in mind as it’s core feature, so the easiest way is to grant Weblate the access to your repository. The import process will guide you through configuring your translations into components.

Alternatively, you can use Weblate to set up a local repository containing all the translations without integration.

Recuperar traducciones actualizadas desde Weblate

To fetch updated strings from Weblate, you can simply fetch the underlying Git repository (either from filesystem, or it can be made available through Git exporter). Prior to this, you might want to commit any pending changes (see Consignas diferidas). You can do so in the user interface (in the Repository maintenance) or from the command line using Cliente de Weblate.

This can be automated if you grant Weblate push access to your repository and configure URL de envío al repositorio in the Configuración de componentes, see Enviar cambios efectuados en Weblate.

Alternatively, you can use API REST de Weblate to update translations to match their latest version.

Recuperar cambios remotos hacia Weblate

To fetch the strings newly updated in your repository into Weblate, just let it pull from the upstream repository. This can be achieved in the user interface (in the Repository maintenance), or from the command line using Cliente de Weblate.

This can be automated by setting a webhook in your repository to trigger Weblate whenever there is a new commit, see Updating repositories for more details.

Si no utiliza una integración con un sistema de control de versiones, puede servirse de la interfaz de usuario o la API REST de Weblate para actualizar las traducciones para que se ajusten a su base de código fuente.

Añadir cadenas nuevas

In case your translation files are stored in a VCS together with the code, you most likely have an existing workflow for developers to introduce new strings. Any way of adding strings will be picked up, but consider using Quality gateway for the source strings to avoid introducing errors.

Cuando los archivos de traducción están separados del código fuente, los procedimientos siguientes le permitirán introducir cadenas nuevas en Weblate.

Nota

Availability of adding strings in Weblate depends on Gestionar cadenas.

Updating target language files

For monolingual files (see Formatos de archivo admitidos) Weblate might add new translation strings not present in the Archivo de base monolingüe, and not in actual translations. It does not however perform any automatic cleanup of stale strings as that might have unexpected outcomes. If you want to do this, please install Limpieza de archivos de traducción addon which will handle the cleanup according to your requirements.

Weblate also will not try to update bilingual files in any way, so if you need po files being updated from pot, you need to do it yourself using Update source strings Métodos de importación or using Actualizar archivos PO para que coincidan con POT (msgmerge) addon.