Häufig gestellte Fragen

Konfiguration

Wie erstellt man einen automatisierten Arbeitsablauf?

Weblate can handle all the translation things semi-automatically for you. If you give it push access to your repository, the translations can happen without interaction, unless some merge conflict occurs.

  1. Set up your Git repository to tell Weblate when there is any change, see Benachrichtigungs-Hooks for info on how to do it.

  2. Set a push URL at your Komponentenkonfiguration in Weblate, this allows Weblate to push changes to your repository.

  3. Turn on Bei Commit gleichzeitig Pushen on your Komponentenkonfiguration in Weblate, this will make Weblate push changes to your repository whenever they happen at Weblate.

Wie greift man über SSH auf Repositorys zu?

Bitte lesen Sie Zugriff auf Repositorys für Informationen zur Einrichtung von SSH-Schlüsseln.

Wie behebt man Merge-Konflikte in Übersetzungen?

Merge conflicts happen from time to time when the translation file is changed in both Weblate and the upstream repository concurrently. You can usually avoid this by merging Weblate translations prior to making changes in the translation files (e.g. before running msgmerge). Just tell Weblate to commit all pending translations (you can do it in Repository maintenance in the Manage menu) and merge the repository (if automatic push is not on).

Wenn Sie bereits auf einen Merge-Konflikt gestoßen sind, ist es am einfachsten, alle Konflikte lokal auf Ihrem Rechner zu lösen, indem Sie Weblate als Remote-Repository hinzufügen, es mit Upstream zusammenführen und alle Konflikte beheben. Sobald Sie die Änderungen pushen, kann Weblate die zusammengeführte Version ohne weitere besondere Maßnahmen verwenden.

Bemerkung

Depending on your setup, access to the Weblate repository might require authentication. When using the built-in Git-Exporter in Weblate, you authenticate with your username and the API key.

# Commit all pending changes in Weblate, you can do this in the UI as well:
wlc commit
# Lock the translation in Weblate, again this can be done in the UI as well:
wlc lock
# Add Weblate as remote:
git remote add weblate https://hosted.weblate.org/git/project/component/
# You might need to include credentials in some cases:
git remote add weblate https://username:APIKEY@hosted.weblate.org/git/project/component/

# Update weblate remote:
git remote update weblate

# Merge Weblate changes:
git merge weblate/main

# Resolve conflicts:
edit …
git add …
…
git commit

# Rebase changes (if Weblate is configured to do rebases)
git rebase origin/main

# Push changes to upstream repository, Weblate will fetch merge from there:
git push

# Open Weblate for translation:
wlc unlock

If you’re using multiple branches in Weblate, you can do the same to all of them:

# Add and update Weblate remotes
git remote add weblate-one https://hosted.weblate.org/git/project/one/
git remote add weblate-second https://hosted.weblate.org/git/project/second/
git remote update weblate-one weblate-second

# Merge QA_4_7 branch:
git checkout QA_4_7
git merge weblate-one/QA_4_7
... # Resolve conflicts
git commit

# Merge main branch:
git checkout main
git merge weblates-second/main
... # Resolve conflicts
git commit

# Push changes to the upstream repository, Weblate will fetch the merge from there:
git push

In case of gettext PO files, there is a way to merge conflicts in a semi-automatic way:

Fetch and keep a local clone of the Weblate Git repository. Also get a second fresh local clone of the upstream Git repository (i. e. you need two copies of the upstream Git repository: An intact and a working copy):

# Add remote:
git remote add weblate /path/to/weblate/snapshot/

# Update Weblate remote:
git remote update weblate

# Merge Weblate changes:
git merge weblate/main

# Resolve conflicts in the PO files:
for PO in `find . -name '*.po'` ; do
    msgcat --use-first /path/to/weblate/snapshot/$PO\
               /path/to/upstream/snapshot/$PO -o $PO.merge
    msgmerge --previous --lang=${PO%.po} $PO.merge domain.pot -o $PO
    rm $PO.merge
    git add $PO
done
git commit

# Push changes to the upstream repository, Weblate will fetch merge from there:
git push

Wie übersetzt man mehrere Branches auf einmal?

Weblate unterstützt das Pushen von Übersetzungsänderungen innerhalb eines Projekts. Für jede Komponente, die dies aktiviert hat (Standardeinstellung), wird die vorgenommene Änderung automatisch an andere weitergegeben. Auf diese Weise werden die Übersetzungen synchron gehalten, auch wenn die Zweige selbst schon sehr weit auseinander liegen und es nicht möglich ist, Übersetzungsänderungen einfach zwischen ihnen zusammenzuführen.

Once you merge changes from Weblate, you might have to merge these branches (depending on your development workflow) discarding differences:

git merge -s ours origin/maintenance

Wie übersetzt man plattformübergreifende Projekte?

Weblate supports a wide range of file formats (see Unterstützte Dateiformate) and the easiest approach is to use the native format for each platform.

Once you have added all platform translation files as components in one project (see Adding translation projects and components), you can utilize the translation propagation feature (turned on by default, and can be turned off in the Komponentenkonfiguration) to translate strings for all platforms at once.

Wie exportiert man das von Weblate verwendete Git-Repository?

There is nothing special about the repository, it lives under the DATA_DIR directory and is named vcs/<project>/<component>/. If you have SSH access to this machine, you can use the repository directly.

For anonymous access, you might want to run a Git server and let it serve the repository to the outside world.

Alternatively, you can use Git-Exporter inside Weblate to automate this.

Welche Möglichkeiten gibt es, um Änderungen wieder Upstream zu pushen?

This heavily depends on your setup, Weblate is quite flexible in this area. Here are examples of some workflows used with Weblate:

  • Weblate automatically pushes and merges changes (see Wie erstellt man einen automatisierten Arbeitsablauf?).

  • You manually tell Weblate to push (it needs push access to the upstream repository).

  • Somebody manually merges changes from the Weblate git repository into the upstream repository.

  • Somebody rewrites history produced by Weblate (e.g. by eliminating merge commits), merges changes, and tells Weblate to reset the content in the upstream repository.

Of course you are free to mix all of these as you wish.

Wie beschränkt man den Weblate-Zugriff auf Übersetzungen, ohne den Quellcode freizugeben?

You can use git submodule for separating translations from source code while still having them under version control.

  1. Create a repository with your translation files.

  2. Add this as a submodule to your code:

    git submodule add git@example.com:project-translations.git path/to/translations
    
  3. Link Weblate to this repository, it no longer needs access to the repository containing your source code.

  4. You can update the main repository with translations from Weblate by:

    git submodule update --remote path/to/translations
    

Please consult the git submodule documentation for more details.

Wie überprüft man ob Weblate richtig eingerichtet ist?

Weblate enthält eine Reihe von Konfigurationsprüfungen, die Sie in der Adminoberfläche sehen können. Folgen Sie einfach dem Link Leistungsbericht in der Adminoberfläche oder öffnen Sie direkt die URL /manage/performance/.

Warum werden alle Commits von Weblate <noreply@weblate.org> übertragen?

This is the default committer name, configured by DEFAULT_COMMITER_EMAIL and DEFAULT_COMMITER_NAME.

The author of every commit (if the underlying VCS supports it) is still recorded correctly as the user that made the translation.

For commits where no authorship is known (for example anonymous suggestions or machine translation results), the authorship is credited to the anonymous user (see ANONYMOUS_USER_NAME). You can change the name and e-mail in the management interface.

Wie verschiebt man Dateien im Repository, ohne den Verlauf in Weblate zu verlieren?

Um den Verlauf, die Kommentare oder Bildschirmfotos, die mit Zeichenketten verknüpft sind, nach einer Änderung des Dateispeicherorts beizubehalten, müssen Sie sicherstellen, dass diese Zeichenketten in Weblate niemals gelöscht werden. Dies kann passieren, wenn das Weblate-Repository aktualisiert wird, die Komponentenkonfiguration aber noch auf die alten Dateien verweist. Dies führt dazu, dass Weblate davon ausgeht, dass es alle Übersetzungen löschen sollte.

The solution to this is to perform the operation in sync with Weblate:

  1. Sperren Sie die betroffene Komponente in Weblate.

  2. Commiten Sie alle ausstehenden Änderungen und führen Sie sie in das Upstream-Repository ein.

  3. Deaktivieren Sie den Empfang von Webhooks für die Projektkonfiguration; dies verhindert, dass Weblate Änderungen im Repository sofort sieht.

  4. Führen Sie alle notwendigen Änderungen im Projektarchiv durch (z. B. mit git mv) und pushen Sie sie in das Upstream-Repository.

  5. Ändern Sie die Komponentenkonfiguration so, dass sie mit der neuen Konfiguration übereinstimmt; wenn Sie die Konfiguration ändern, wird Weblate das aktualisierte Repository abrufen und die geänderten Orte bemerken, während die bestehenden Zeichenketten erhalten bleiben.

  6. Entsperren Sie die Komponente und aktivieren Sie die Hooks in der Projektkonfiguration wieder.

Anwendung

Wie überprüft man die Übersetzungen anderer?

  • Es gibt mehrere überprüfungsbasierte Arbeitsabläufe in Weblate, siehe :ref:‘workflows‘.

  • Sie können alle Änderungen, die in Abonnements gemacht werden, abonnieren und dann andere Beiträge, die per E-Mail eintreffen, überprüfen.

  • Am unteren Rand der Übersetzungsansicht steht ein Überprüfungstool zur Verfügung, mit dem Sie Übersetzungen durchsuchen können, die seit einem bestimmten Datum von anderen erstellt wurden.

Wie gibt man Rückmeldung zu einer Ausgangszeichenkette?

On context tabs below translation, you can use the Comments tab to provide feedback on a source string, or discuss it with other translators.

Wie verwendet man vorhandene Übersetzungen beim Übersetzen?

  • Dank des gemeinsamen Übersetzungsspeichers können alle Übersetzungen innerhalb von Weblate verwendet werden.

  • Sie können vorhandene Übersetzungsspeicherdateien in Weblate importieren.

  • Use the import functionality to load compendium as translations, suggestions or translations needing review. This is the best approach for a one-time translation using a compendium or a similar translation database.

  • You can set up tmserver with all databases you have and let Weblate use it. This is good when you want to use it several times during translation.

  • Another option is to translate all related projects in a single Weblate instance, which will make it automatically pick up translations from other projects as well.

Aktualisiert Weblate neben den Übersetzungen auch die Übersetzungsdateien?

Weblate tries to limit changes in translation files to a minimum. For some file formats it might unfortunately lead to reformatting the file. If you want to keep the file formatted your way, please use a pre-commit hook for that.

Woher kommen die Sprachdefinitionen und wie fügt man eigene Definitionen hinzu?

The basic set of language definitions is included within Weblate and Translate-toolkit. This covers more than 150 languages and includes info about plural forms or text direction.

You are free to define your own languages in the administrative interface, you just need to provide info about it.

Siehe auch

Sprachdefinitionen

Kann Weblate Änderungen in einer fragwürdigen Zeichenkette hervorheben?

Weblate supports this, however it needs the data to show the difference.

For Gettext PO files, you have to pass the parameter --previous to msgmerge when updating PO files, for example:

msgmerge --previous -U po/cs.po po/phpmyadmin.pot

For monolingual translations, Weblate can find the previous string by ID, so it shows the differences automatically.

Warum zeigt Weblate immer noch alte Übersetzungszeichenketten an, obwohl die Vorlage aktualisiert wurde?

Weblate does not try to manipulate the translation files in any way other than allowing translators to translate. So it also does not update the translatable files when the template or source code have been changed. You simply have to do this manually and push changes to the repository, Weblate will then pick up the changes automatically.

Bemerkung

It is usually a good idea to merge changes done in Weblate before updating translation files, as otherwise you will usually end up with some conflicts to merge.

For example with gettext PO files, you can update the translation files using the msgmerge tool:

msgmerge -U locale/cs/LC_MESSAGES/django.mo locale/django.pot

In case you want to do the update automatically, you can install add-on PO-Dateien auf POT aktualisieren (msgmerge).

Fehlerbehebung

Anfragen schlagen manchmal mit der Fehlermeldung „zu viele offene Dateien“ fehl

This happens sometimes when your Git repository grows too much and you have many of them. Compressing the Git repositories will improve this situation.

The easiest way to do this is to run:

# Go to DATA_DIR directory
cd data/vcs
# Compress all Git repositories
for d in */* ; do
    pushd $d
    git gc
    popd
done

Siehe auch

DATA_DIR

Beim Zugriff auf die Website erscheint die Fehlermeldung „Fehlerhafte Anfrage (400)“

This is most likely caused by an improperly configured ALLOWED_HOSTS. It needs to contain all hostnames you want to access on your Weblate. For example:

ALLOWED_HOSTS = ["weblate.example.com", "weblate", "localhost"]

Was bedeutet „Es gibt mehrere Dateien für die einzelne Sprache (en)“?

This typically happens when you have translation file for source language. Weblate keeps track of source strings and reserves source language for this. The additional file for same language is not processed.

  • Falls die Übersetzung in die Ausgangssprache gewünscht ist, ändern Sie bitte die Ausgangssprache in den Komponenteneinstellungen. Vielleicht möchten Sie Englisch (Entwickler) als Ausgangssprache verwenden, oder das Qualitäts-Gateway für die Ausgangszeichenketten nutzen.

  • Falls die Übersetzungsdatei für die Ausgangssprache nicht benötigt wird, entfernen Sie diese bitte aus dem Repository.

  • Falls die Übersetzungsdatei für die Ausgangssprache benötigt wird, aber von Weblate ignoriert werden soll, stellen Sie bitte den Sprachen-Filter so ein, dass er sie ausschließt.

Hinweis

You might get similar error message for other languages as well. In that case the most likely reason is that several files map to single language in Weblate.

This can be caused by using obsolete language codes together with new one (ja and jp for Japanese) or including both country specific and generic codes (fr and fr_FR). See Parsing von Sprachcodes for more details.

Funktionen

Unterstützt Weblate auch andere VCS als Git und Mercurial?

Weblate currently does not have native support for anything other than Git (with extended support for GitHub-Pull-Requests, Gerrit and Subversion) and Mercurial, but it is possible to write backends for other VCSes.

You can also use Git remote helpers in Git to access other VCSes.

Weblate also supports VCS-less operation, see Lokale Dateien.

Bemerkung

For native support of other VCSes, Weblate requires using distributed VCS, and could probably be adjusted to work with anything other than Git and Mercurial, but somebody has to implement this support.

Wie erfolgt der Übersetzungsnachweis bei Weblate?

Every change made in Weblate is committed into VCS under the translators name. This way every single change has proper authorship, and you can track it down using the standard VCS tools you use for code.

Additionally, when the translation file format supports it, the file headers are updated to include the translator’s name.

Warum erzwingt Weblate die Anzeige aller PO-Dateien in einem einzigen Baum?

Weblate was designed in a way that every PO file is represented as a single component. This is beneficial for translators, so they know what they are actually translating.

Geändert in Version 4.2: Übersetzer können alle Komponenten eines Projekts als Ganzes in eine bestimmte Sprache übersetzen.

Warum verwendet Weblate Sprachcodes wie sr_Latn oder zh_Hant?

Dies sind Sprachcodes, die von RFC 5646 definiert wurden, um besser anzuzeigen, dass es sich wirklich um verschiedene Sprachen handelt, anstatt der bisher falsch verwendeten Modifikatoren (für @latin-Varianten) oder Ländercodes (für Chinesisch).

Weblate versteht immer noch die herkömmlichen Sprachcodes und wird sie auf die aktuellen abbilden – zum Beispiel wird sr@latin als sr_Latn oder zh@CN als zh_Hans behandelt.

Bemerkung

Weblate verwendet standardmäßig Sprachcodes im POSIX-Stil mit Unterstrich, siehe Sprachdefinitionen für weitere Details.