Integracja z Weblate¶
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 Zasoby ciągów systemu 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 Konfiguracja komponentu using Zezwól na propagację tłumaczenia in case the translations should diverge.
Importowanie projektu lokalizacyjnego do 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.
Pobieranie zaktualizowanych tłumaczeń z 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 Eksporter Git). Prior to this, you might want to commit any pending changes (see Leniwe zatwierdzenia). You can do so in the user interface (in the Repository maintenance) or from the command line using Klient Weblate.
Alternatively, you can use REST API Weblate 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 Klient Weblate.
This can be automated by setting a webhook in your repository to trigger Weblate whenever there is a new commit, see Aktualizacja repozytoriów for more details.
If you’re not using a VCS integration, you can use UI or REST API Weblate to update translations to match your code base.
Dodawanie nowych ciągów¶
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.
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 language used as the source for translations.
Programatically, using API
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 Metody importu.
Availability of adding strings in Weblate depends on Zarządzanie ciągami.
Updating target language files¶
For monolingual files (see Obsługiwane formaty plików) Weblate might add new translation strings not present in the Jednojęzyczny bazowy plik języka, 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 Wyczyść pliki tłumaczenia 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 Metody importu or using
Zaktualizuj pliki PO, aby dopasować POT (msgmerge) addon.
Managing version control repository¶
Weblate stores all translation the version control repository. It can be either connected to upstream one, or it can be only internal. The Repository maintenance lets you manipulate with the repository.
With Ciągła lokalizacja the repository is automatically pushed whenever there are changes and there is usually no need to manually manipupate with it.
Following operations are available:
Commits any pending changes present in Weblate database and not in the repository, see Leniwe zatwierdzenia.
Pushes changes to the upstream repository, if configured by URL repozytorium dla push.
Update, Pull, Rebase
Updates Weblate repository with upstream changes. It uses Scalanie stylów when choosing Update or you can choose different one from the dropdown menu.
Blokowanie uniemożliwia tłumaczom wprowadzenie zmian
Reset from Maintenance
Resets any changes done in Weblate to match upstream repository. This will discard all translations done in Weblate and not present in the upstream repository.
Cleanup from Maintenance
Removes untracked files from the repository. These could be result of misbehaving add-ons or bugs.
Force synchronization from Maintenance
Forces writing all strings to the translation files. Use this when repository files became out of sync with Weblate for some reason.