mbox series

[bug#63483,v2,0/4] build: Update po4a process.

Message ID cover.1713073114.git.gemmaro.dev@gmail.com
Headers show
Series build: Update po4a process. | expand

Message

gemmaro April 14, 2024, 7:18 a.m. UTC
Hello,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> tags 63483 + moreinfo
> quit
>
> Hi gemmaro,
>
> Thanks for doing this!
>
> I have surveyed the series, and I'll need to dive into the details to
> see if everything adds up, but it looks good!
>
> We include a GNU ChangeLog in our git commit messages, as mentioned in
> info '(guix) Submitting Patches'.  There's a cross-reference to 'info
> (standards)Change Logs', which is made available upon installing the
> 'standards' Guix package (and 'info-reader').  This changelog should be
> a high level description of the changes, which is handy when reviewing.
>
> I hope this helps!  I hope to see a v2 soon :-)
>
> -- 
> Thanks,
> Maxim

Thank you for your response.  I read the chapter on Change Logs and rewrote it
to tried to make it more descriptive and more purposeful.

To recap, the goal of this change is to eliminate the po4a warning
("po4a-{updatepo,translate} is deprecated.  The unified po4a(1) program is
more convenient and less error prone.").  I checked it works by running "make"
and "make as-derivation".  The location of the PO files is not changed, so
Weblate can continue to be used as is.

Several things have changed since revision 1.  Firstly, I have broken down the
process and tried to write better commit messages and comments to make the
changes easier to grasp.  Secondly, I used po4a in batches in revision 1, but
this may not be suitable for the use case for Guix, so I left as is.

If it is the case to run po4a in batches, the change might be similar to the
revision 1.  However, there are the following concerns.  Because of these and
the aim here to clear po4a warnings, I don't use po4a in bulk.

 1) It may take more time to process the translations.  Combining them in one
    configuration file increases the number of target files to be handled.

 2) The Makefiles (doc/local.mk and po/doc/local.mk) become more complex,
    since a single run of po4a will update multiple files.

 3) PO files will need to be addressed.  Currently two are covered - manuals
    and cookbooks - but the merging of gettext entries will cause conflicts if
    there are different translations (msgstr) for the same source text
    (msgid).  I also think that the configuration of Weblate will then need to
    be changed[3] simultaneously.

 4) There would be some new almost empty PO files generated.

I noticed that the similar change[1] has been proposed.  It is possible that
action will be taken on the po4a side, but in the meantime we may encounter
problems that were not addressed in po4a-{updatepo,translate} [2].

[1] [PATCH] gnu: Replace deprecated po4a-* calls with po4a,
https://issues.guix.gnu.org/70042

[2] Why are the individual scripts deprecated?,
https://po4a.org/man/man7/po4a.7.php.en

[3] Translation projects / Allow translation propagation,
https://docs.weblate.org/en/latest/admin/projects.html#allow-translation-propagation

Regards,
gemmaro.

gemmaro (4):
  build: Align the Automake status lines of the po4a and the PO xref.
  build: Update the POT creation task with the po4a command.
  build: Use the po4a command for the translation generation.
  self: Use po4a instead of po4a-translate.

 Makefile.am     |  5 +++--
 configure.ac    |  3 +--
 doc/local.mk    | 30 +++++++++++++++++++++++-------
 guix/self.scm   | 12 +++++++++---
 po/doc/local.mk | 15 ++++++++-------
 po/doc/po4a.cfg | 32 ++++++++++++++++++++++++++++++++
 6 files changed, 76 insertions(+), 21 deletions(-)
 create mode 100644 po/doc/po4a.cfg


base-commit: 51de844a0ff6ea224367a384092896bce6848b9f

Comments

pelzflorian (Florian Pelz) April 15, 2024, 4:04 p.m. UTC | #1
Thank you, gemmaro, for driving this necessary change.  It is a good
idea to switch to the actual PO4A script that still gets updates by
PO4A maintainers.

You will have to coordinate with Julien Lepiller (added to Cc) who
controls the Guix-translations repository. [1]

Guix-translations is the repository that Weblate has access to (because
we do not want Weblate to push directly to Guix.git directly).  It will
need your po4a.cfg and the same kind of Makefile updates.

In your original v1 patch, you had updated contributing.texi.
contributing.texi is already out of date, but I believe we better update
it at a later time when we can refer people adding new languages to
prior commits where new languages have been added.

Regards,
Florian

[1] https://framagit.org/tyreunom/guix-translations
gemmaro April 28, 2024, 8:55 a.m. UTC | #2
Hello Florian Pelz and Julien Lepiller,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> writes:

> Thank you, gemmaro, for driving this necessary change.  It is a good
> idea to switch to the actual PO4A script that still gets updates by
> PO4A maintainers.
>
> You will have to coordinate with Julien Lepiller (added to Cc) who
> controls the Guix-translations repository. [1]

Thank you very much for telling me about the repository.  I also got an
idea of the translation flow in Guix using Weblate; Weblate refers to
and updates the PO files in the Guix-translations repository, and that
the PO files in the Guix.git cloned in it are updated by the Makefile.

> Guix-translations is the repository that Weblate has access to (because
> we do not want Weblate to push directly to Guix.git directly).  It will
> need your po4a.cfg and the same kind of Makefile updates.

The changes in revision 2 don't alter the location of PO files and the
scripts under the scripts directory.  I couldn't find additional changes
to the po4a.cfg and the Makefiles.

What do you think, Julien Lepiller?  If there are any changes that
should be made, I would appreciate it if you could correct me.

The po4a.cfg added by this change allows quite flexible specification of
file paths by passing variables (with po4a's "--variable key=value"
option.)  It would be therefore possible to make the Guix-translations
repository also use the integrated po4a program anytime.  The Texinfo
parser used by po4a (and po4a-* scripts) is the same before and after
the change, so there should be no side-effect on the PO files.

> In your original v1 patch, you had updated contributing.texi.
> contributing.texi is already out of date, but I believe we better update
> it at a later time when we can refer people adding new languages to
> prior commits where new languages have been added.
>
> Regards,
> Florian
>
> [1] https://framagit.org/tyreunom/guix-translations

When I was writing this, I noticed that I have transferred some
configuration to po4a.cfg and now there is one more place to specify the
languages (in the po4a_langs section.)  The documentation will need to
be updated in the future in this respect.

Regards,
gemmaro.