[libvirt PATCH 0/4] po: misc fixes after conversion to weblate

A bunch of random stuff that was missed in my first series converting to weblate. Daniel P. Berrangé (4): po: update docs to refer to Weblate instead of Zanata po: remove obsolete zanata push/pull rules po: remove obsolete zanata config file po: fix update-po target to take account of libvirt.pot in srcdir README.rst | 3 ++ docs/contribute.html.in | 4 +- docs/hacking.rst | 10 ++-- po/Makefile.am | 23 ++------- po/README.rst | 111 +++++++++++----------------------------- po/zanata.xml | 7 --- 6 files changed, 46 insertions(+), 112 deletions(-) delete mode 100644 po/zanata.xml -- 2.26.2

The old information about managing PO files was outdated, as we're managing files in a different way with Weblate. This also introduces a badge showing the translation progress across languages. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- README.rst | 3 ++ docs/contribute.html.in | 4 +- docs/hacking.rst | 10 ++-- po/README.rst | 111 +++++++++++----------------------------- 4 files changed, 41 insertions(+), 87 deletions(-) diff --git a/README.rst b/README.rst index 5d6ca5577a..ac6a4cd3e9 100644 --- a/README.rst +++ b/README.rst @@ -7,6 +7,9 @@ .. image:: https://bestpractices.coreinfrastructure.org/projects/355/badge :target: https://bestpractices.coreinfrastructure.org/projects/355 :alt: CII Best Practices +.. image:: https://translate.fedoraproject.org/widgets/libvirt/-/libvirt/svg-badge.svg + :target: https://translate.fedoraproject.org/engage/libvirt/ + :alt: Translation status ============================== Libvirt API for virtualization diff --git a/docs/contribute.html.in b/docs/contribute.html.in index 42a1b2fe60..81efa2bce3 100644 --- a/docs/contribute.html.in +++ b/docs/contribute.html.in @@ -42,8 +42,8 @@ <li><strong>Translation</strong>. All the libvirt modules aim to support translations where appropriate. All translation is handling outside of the normal libvirt review process, - using the <a href="http://fedora.zanata.org">Fedora - instance</a> of the Zanata tool. Thus people wishing + using the <a href="https://translate.fedoraproject.org/projects/libvirt/libvirt">Fedora + instance</a> of the Weblate tool. Thus people wishing to contribute to translation should join the Fedora translation team</li> <li><strong>Documentation</strong>. There are docbook guides on various diff --git a/docs/hacking.rst b/docs/hacking.rst index 51ff862e8f..ccc94010b3 100644 --- a/docs/hacking.rst +++ b/docs/hacking.rst @@ -13,11 +13,11 @@ The official upstream repository is kept in git along with other libvirt-related repositories (e.g. libvirt-python) `online <https://gitlab.com/libvirt>`__. -Patches to translations are maintained via the `zanata -project <https://fedora.zanata.org/>`__. If you want to fix a -translation in a .po file, join the appropriate language team. -The libvirt release process automatically pulls the latest -version of each translation file from zanata. +Patches to translations are maintained via the `Fedora Weblate +service <https://translate.fedoraproject.org/projects/libvirt/libvirt>`__. +If you want to contirbute to translations of libvirt, join the appropriate +language team in Weblate. Translation updates to libvirt will be merged +during the feature freeze window. Preparing patches ================= diff --git a/po/README.rst b/po/README.rst index 2e234547ca..8d566cd967 100644 --- a/po/README.rst +++ b/po/README.rst @@ -2,89 +2,40 @@ Libvirt Message Translation =========================== -Libvirt translatable messages are maintained using the GNU Gettext tools and -file formats, in combination with the Zanata web service. +.. image:: https://translate.fedoraproject.org/widgets/libvirt/-/libvirt/multi-auto.svg + :target: https://translate.fedoraproject.org/engage/libvirt/ + :alt: Translation status -python-zanata-client is required in order to use make to pull/push translations -from/to Zanata server. +Libvirt translatable messages are maintained using the GNU Gettext tools and +file formats, in combination with the Fedora Weblate web service. +https://translate.fedoraproject.org/projects/libvirt/libvirt/ Source repository ================= -The libvirt GIT repository does NOT store the master "libvirt.pot" file, nor -does it store full "po" files for translations. The master "libvirt.pot" file -can be generated at any time using - -:: - - $ make libvirt.pot - -The translations are kept in minimized files that are the same file format -as normal po files but with all redundant information stripped and messages -re-ordered. The key differences between the ".mini.po" files in GIT and the -full ".po" files are - -* msgids with no current translation are omitted -* msgids are sorted in alphabetical order not source file order -* msgids with a msgstr marked "fuzzy" are discarded -* source file locations are omitted - -The full po files can be created at any time using - -:: - - $ make update-po - -This merges the "libvirt.pot" with the "$LANG.mini.po" for each language, to -create the "$LANG.po" files. These are included in the release archives created -by "make dist". - -When a full po file is updated, changes can be propagated back into the -minimized po files using - -:: - - $ make update-mini-po - -Note, however, that this is generally not something that should be run by -developers normally, as it is triggered by 'make pull-po' when refreshing -content from Zanata. - - -Zanata web service -================== - -The translation of libvirt messages has been outsourced to the Fedora -translation team using the Zanata web service: - -https://fedora.zanata.org/project/view/libvirt - -As such, changes to translations will generally NOT be accepted as patches -directly to libvirt GIT. Any changes made to "$LANG.mini.po" files in libvirt -GIT will be overwritten and lost the next time content is imported from Zanata. - -The master "libvirt.pot" file is periodically pushed to Zanata to provide the -translation team with content changes, using - -:: - - $ make push-pot - -New translated text is then periodically pulled down from Zanata to update the -minimized po files, using - -:: - - $ make pull-po - -Sometimes the translators make mistakes, most commonly with handling printf -format specifiers. The "pull-po" command re-generates the .gmo files to try to -identify such mistakes. If a mistake is made, the broken msgstr should be -deleted in the local "$LANG.mini.po" file, and the Zanata web interface used -to reject the translation so that the broken msgstr isn't pulled down next time. - -After pulling down new content the diff should be examined to look for any -obvious mistakes that are not caught automatically. There have been bugs in -Zanata tools which caused messges to go missing, so pay particular attention to -diffs showing deletions where the msgid still exists in libvirt.pot +The libvirt GIT repository stores the master "libvirt.pot" file, which is to be +refreshed at time of feature freeze. + +The "po" files stored in GIT have source locations removed in order to cut down +on storage size, by eliminating information already present in the "pot" file. +All files are stored with strings sorted in alphabetical order rather than +source location order, to minimize movement of strings when source locations +change. + +The "po" files are to be EXCLUSIVELY UPDATED by merge requests sent from the +Fedora Weblate service. Other contributors MUST NEVER send changes which touch +the "po" file content, as that will create merge conflicts for Weblate. IOW any +bug fixes to translations should be made via the Weblate application UI. + +After the "pot" file in libvirt GIT, Weblate will automatically run "msgmerge" +to update the "po" files itself and send back a merge request with the changes. + +Translation updates made in the Weblate Web UI will be committed to its fork of +the GIT repo once a day. These commits will be submitted back to the master GIT +repo via merge requests. If a merge request from Weblate is already open, +commits will be added to this existing merge request. Weblate will take care of +rebasing whenever changes happen in Git master. In order to avoid having to do +translations merges 30 times a month, merge requests from Weblate will usually +be left open until feature freeze arrives. During the freeze period, they will +be accepted more promptly to ensure they make it into the new release. -- 2.26.2

We're no longer using Zanata, so remove the old push/pull rules. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- po/Makefile.am | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/po/Makefile.am b/po/Makefile.am index e4d444dad6..97e05a32f6 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -52,22 +52,6 @@ update-po: $(POTFILE) mv $$lang.po-t $$lang.po done -push-pot: $(POTFILE) - zanata push \ - --project-config $(srcdir)/zanata.xml \ - --push-type=source \ - --transdir $(builddir) \ - --srcdir $(srcdir) - -pull-po: $(POTFILE) - zanata pull \ - --project-config $(srcdir)/zanata.xml \ - --create-skeletons \ - --transdir $(builddir) \ - --srcdir $(srcdir) - $(MAKE) update-po - $(MAKE) update-gmo - $(POTFILE): POTFILES $(XGETTEXT) -o $@-t $(XGETTEXT_ARGS) \ --files-from=$(abs_builddir)/POTFILES -- 2.26.2

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- po/zanata.xml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 po/zanata.xml diff --git a/po/zanata.xml b/po/zanata.xml deleted file mode 100644 index 421980a3e3..0000000000 --- a/po/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<config xmlns="http://zanata.org/namespace/config/"> - <url>https://fedora.zanata.org/</url> - <project>libvirt</project> - <project-version>master</project-version> - <project-type>gettext</project-type> -</config> -- 2.26.2

Now that we're storing libvirt.pot in git, it will be in srcdir instead of builddir. Weblate is responsible for running msgmerge when the .pot file changes, so add a warning that this target is not for general usage. --- po/Makefile.am | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/po/Makefile.am b/po/Makefile.am index 97e05a32f6..95294aa12e 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -43,13 +43,16 @@ SED_PO_FIXUP_ARGS = \ update-gmo: $(GMOFILES) +# The results of this target should not be committed to Git. The Weblate +# service is responsible for updating .po files when the .pot is changed. update-po: $(POTFILE) + cd $(srcdir) && \ for lang in $(LANGS); do \ echo "Minimizing $$lang content" && \ $(MSGMERGE) --no-location --no-fuzzy-matching --sort-output \ $$lang.po $(POTFILE) | \ - $(SED) $(SED_PO_FIXUP_ARGS) > $(srcdir)/$$lang.po-t && \ - mv $$lang.po-t $$lang.po + $(SED) $(SED_PO_FIXUP_ARGS) > $$lang.po-t && \ + mv $$lang.po-t $$lang.po ; \ done $(POTFILE): POTFILES -- 2.26.2

On Mon, Jun 08, 2020 at 11:58:36AM +0100, Daniel P. Berrangé wrote:
A bunch of random stuff that was missed in my first series converting to weblate.
Daniel P. Berrangé (4): po: update docs to refer to Weblate instead of Zanata po: remove obsolete zanata push/pull rules po: remove obsolete zanata config file po: fix update-po target to take account of libvirt.pot in srcdir
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (2)
-
Daniel P. Berrangé
-
Pavel Hrdina