guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#47882] [PATCH] Makefile: Reimplement download-po target


From: Julien Lepiller
Subject: [bug#47882] [PATCH] Makefile: Reimplement download-po target
Date: Mon, 19 Apr 2021 00:09:58 +0200

Hi Guix!

The attached patch reimplements the download-po target in Makefile.am.
The previous implementation was based on the implementation for the TP
and would use the API of Weblate to get files.

However, the rate-limit is very close to the number of files we need to
download, which was a big limitation, and this target would only
download existing files, ignoring new translations.

With this, new translations and existing ones are added/updated. The
target will first do a shallow clone of the repository behind
Weblate. Then, it will check that files are not empty (contain at least
one translated string) and correct (according to scheme-format at
least). If they are correct, it will normalize them and copy them to
the po/ subdir in the repository.

Here is an example output:

copied po/doc/guix-manual.ru.po.
/tmp/tmp.dWvtATfWQA/translations/po/doc/guix-manual.si.po:6:
AVERTISSEMENT : Le champ d'en-tête « PO-Revision-Date » a encore sa
valeur initiale par défaut
WARN: po/doc/guix-manual.si.po (0 translated messages) was not
added/updated.
/tmp/tmp.dWvtATfWQA/translations/po/guix/nl.po:5135: Les spécifications
de format dans « msgid_plural » et « msgstr[1] » ne sont pas
équivalentes
msgfmt: 1 erreur fatale trouvée
WARN: po/guix/nl.po (1001 translated messages) was not added/updated.

In this output, we can see that the Russian manual was copied, the
Sinhala manual was empty, so not copied, and the Dutch translation had
an issue in one string that needs to be fixed, and was not copied.

I chose not to copy the file because an issue in msgfmt would break
guix pull. Unfortunately, this is not enough testing, as the manual and
cookbook are not checked. Checking them requires building the manual,
so before commiting changes, please run "make".

To document the new process:

make download-po
for any new file in po/guix and po/packages, add the language in a
single line in po/guix/LINGUAS or po/packages/LINGUAS.
for any new file in po/doc, add the file name to po/doc/local.mk, in
DOC_PO_FILES or DOC_COOKBOOK_PO_FILES depending on the translation
type. Add the texi file name to doc/local.mk too, in info_TEXINFOS.

Attachment: 0001-Makefile-Reimplement-download-po-target.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]