Integración con Weblate

Fundamentos de Weblate

Projects and components structure

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 GNU gettext 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 in case the translations should diverge.

Importing localization project into Weblate

Weblate was developed with VCS integration in mind. The easiest approach to integrate with it is to grant access to your VCS repository. The import process will guide you through configuring components with your translations.

In case you do not use VCS or do not want to grant access to your VCS at all, you can use Weblate without a remote VCS repository - it will create local repository with all the translations.

Getting translations updates from Weblate

To fetch updated strings from Weblate you can simply fetch the underlying 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). This can be achieved in the user interface (in the Repository maintenance) or from 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.

Pushing string changes to Weblate

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

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

When not using a VCS integration, you can use UI or API REST de Weblate to update translations to match your code base.

Adding new strings

In case your translation files are stored in VCS together with the code, you most likely have existing workflow for developers to introduce new strings. You might extend it by using Quality gateway for the source strings.

When the translation files are separate, there needs to be a way to introduce new strings. Weblate can add new strings on monolingual translations only (see Formatos bilingües y monolingües). You have three options to do that: