Dokumentation mit Sphinx übersetzen¶
Sphinx ist ein Tool zur Erstellung schöner Dokumentationen. Es verwendet eine einfache reStructuredText-Syntax und kann Ausgaben in vielen Formaten erzeugen. Falls Sie nach einem Beispiel suchen, diese Dokumentation wurde ebenfalls mit Sphinx erstellt. Ein sehr nützlicher Begleiter für die Verwendung von Sphinx ist der Dienst Read the Docs, der Ihre Dokumentation kostenlos erstellt und veröffentlicht.
I will not focus on writing documentation itself, if you need guidance with
that, just follow instructions on the Sphinx website. Once you have
documentation ready, translating it is quite easy as Sphinx comes with support
for this and it is quite nicely covered in their Internationalization. It’s
matter of a few configuration directives and invoking the sphinx-intl
tool.
If you are using Read the Docs service, you can start building translated documentation on Read the Docs. Their Localization and Internationalization covers pretty much everything you need - creating another project, setting its language, and linking it from the main project as a translation.
Now all you need is translating the documentation content. Sphinx generates PO
file for each directory or top-level file, which can lead to quite a lot of
files to translate (depending on gettext_compact settings).
You can import the index.po into Weblate as an initial component and
then configure Komponentenerkennung add-on to automatically
discover all others.
|
|
|
|
|
|
gettext PO-Datei |
|
|
Regulärer Ausdruck zum Abgleich von Übersetzungsdateien |
|
Anpassen des Komponentennamens |
|
Definition der Basisdatei für neue Übersetzungen |
|
Hinweis
Möchten Sie, dass Sphinx nur eine einzige PO-Datei erzeugt? Seit Sphinx 3.3.0 können Sie dies erreichen:
gettext_compact = "docs"
Es gibt mehrere Dokumentationsprojekte, die nach diesem Konzept übersetzt werden:
Weblate-Dokumentation (Sie lesen das gerade)