Integrating with Weblate
Weblate basics
Project and component 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 Android string resources). 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 Component configuration using Verbreitung von Übersetzungen erlauben 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.
Fetching updated translations from 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 Lazy commits). You can do so in the user interface (in the Repository maintenance) or from the command-line using Weblate Client.
This can be automated if you grant Weblate push access to your repository and configure Push-URL für Repository in the Component configuration, see Pushing changes from Weblate.
Alternatively, you can use Weblate’s REST API to update translations to match their latest version.
Fetching remote changes into 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 Weblate Client.
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.
If you’re not using a VCS integration, you can use UI or Weblate’s REST API to update translations to match your code base.
Siehe auch
Adding new strings
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 Qualitäts-Gateway für die Ausgangszeichenketten to avoid introducing errors.
When the translation files are separate from the code, there are following ways to introduce new strings into Weblate.
Manually, using Add new translation string from Tools menu in the source language.
Programmatically, using API
POST /api/translations/(string:project)/(string:component)/(string:language)/units/
.By uploading source file as Replace existing translation file (this overwrites existing strings, so please make sure the file includes both old and new strings) or Add new strings, see Import methods.
Bemerkung
Availability of adding strings in Weblate depends on Zeichenketten verwalten.
Updating target language files
For monolingual files (see Supported file formats) Weblate might add new translation strings not present in the Einsprachige Basis-Sprachdatei, 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 Übersetzungsdateien bereinigen add-on 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 Import methods or using
PO-Dateien auf POT aktualisieren (msgmerge) add-on.
Verwalten des Repository der Versionsverwaltung
Weblate speichert alle Übersetzungen im Repository der Versionsverwaltung. Es kann entweder mit einem Upstream-Repository verbunden sein, oder nur intern sein. Das Repository maintenance lässt Sie mit dem Repository manipulieren.
Hinweis
Mit Kontinuierliche Lokalisierung wird das Repository automatisch gepusht, wenn es Änderungen gibt, und es besteht normalerweise keine Notwendigkeit, es manuell zu bearbeiten.

Die folgenden Operationen sind verfügbar:
Commit
Committen Sie alle ausstehenden Änderungen, die in der Weblate-Datenbank und nicht im Repository vorhanden sind, siehe Lazy commits.
Push
Änderungen in das Upstream-Repository pushen, falls mit Push-URL für Repository konfiguriert.
Update, Pull, Rebase
Aktualisiert das Weblate-Repository mit Upstream-Änderungen. Es verwendet Name der Komponente bei der Auswahl von Update oder Sie können etwas anderes aus dem Dropdown-Menü auswählen.
Lock
Sperren verhindert, dass Übersetzer Änderungen vornehmen können
Reset von Wartung
Setzt alle in Weblate vorgenommenen Änderungen auf das Upstream-Repository zurück. Dadurch werden alle in Weblate vorgenommenen Übersetzungen verworfen, die nicht im Upstream-Repository vorhanden sind.
Bereinigungsvorgang from Wartung
Entfernt nicht nachverfolgte Dateien aus dem Repository. Diese könnten das Ergebnis von fehlerhaften Erweiterungen oder Fehlern sein.
Force synchronization from Wartung
Erzwingt das Schreiben aller Zeichenketten in die Übersetzungsdateien. Verwenden Sie dies, wenn die Repository-Dateien aus irgendeinem Grund nicht mehr mit Weblate synchronisiert sind.