GNU bug report logs - #46044
[PATCH] Improvements to handling po files

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Fri, 22 Jan 2021 20:35:02 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46044 in the body.
You can then email your comments to 46044 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#46044; Package guix-patches. (Fri, 22 Jan 2021 20:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Lepiller <julien <at> lepiller.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 22 Jan 2021 20:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: guix-patches <at> gnu.org
Subject: [PATCH] Improvements to handling po files
Date: Fri, 22 Jan 2021 21:34:02 +0100
[Message part 1 (text/plain, inline)]
Hi Guix,

here are two patches to improve our handling of po files. Yesterday I
pushed again new po files that were broken, and I didn't notice. The
first patch ensure po files are normalized. The TP automatically
normalized po, but weblate doesn't, using the indent method instead.
This creates huge patches like yesterday. Instead, normalizing ensures
we only see relevant changes.

The second patch adds a check-po target to the Makefile that runs
msgfmt on every po file we have, to make sure they are at least
correct. That's not enough for manual translations, but that can be
spotted easily when running "make". This would have spotted the issues
I introduced yesterday.
[0001-Makefile.am-Normalize-downloaded-po-files.patch (text/x-patch, attachment)]
[0002-Makefile.am-Add-check-po-rule.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#46044; Package guix-patches. (Thu, 28 Jan 2021 14:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 46044 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 46044 <at> debbugs.gnu.org
Subject: Re: bug#46044: [PATCH] Improvements to handling po files
Date: Thu, 28 Jan 2021 15:58:19 +0100
Hi!

Julien Lepiller <julien <at> lepiller.eu> skribis:

> here are two patches to improve our handling of po files. Yesterday I
> pushed again new po files that were broken, and I didn't notice. The
> first patch ensure po files are normalized. The TP automatically
> normalized po, but weblate doesn't, using the indent method instead.
> This creates huge patches like yesterday. Instead, normalizing ensures
> we only see relevant changes.

Makes sense.

> The second patch adds a check-po target to the Makefile that runs
> msgfmt on every po file we have, to make sure they are at least
> correct. That's not enough for manual translations, but that can be
> spotted easily when running "make". This would have spotted the issues
> I introduced yesterday.

Yes, or running “make as-derivation” (sometimes just “make” isn’t enough
to catch issues it seems, not sure why.)

>>From 42aa42512dba281f3d33e7883c922c0f5704bee4 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Fri, 22 Jan 2021 21:28:28 +0100
> Subject: [PATCH 1/2] Makefile.am: Normalize downloaded po files.
>
> * Makefile.am (make-download-po-rule): Normalize po files.

OK!

>>From 8be36b2d651be108bc1e7fe7790f889dd19c679d Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Fri, 22 Jan 2021 21:24:23 +0100
> Subject: [PATCH 2/2] Makefile.am: Add check-po rule.
>
> * Makefile.am (make-check-po-rule): New definition.
> Add top-level 'eval' and calls to 'make-check-po-rule' to generate
> 'check-po.DOMAIN' rules.
> (check-po): New rule.

[...]

> +# make-check-po-rule DOMAIN DIRECTORY [FILE-NAME-PREFIX]
> +define make-check-po-rule

Could you add a line or two above the definition explaining what it
does?

> +check-po.$(1):
> +	if [ -f "$(top_srcdir)/$(2)/LINGUAS" ]; then				\
> +	  LINGUAS="`grep -v '^[[:blank:]]*#' < $(top_srcdir)/$(2)/LINGUAS`" ;	\
> +	else									\
> +	  LINGUAS="`(cd $(top_srcdir)/$(2);					\
> +	    for i in *.po; do echo $$$$i; done) | cut -d . -f 2`" ;		\
> +	fi ;									\
> +	for lang in $$$$LINGUAS; do						\
> +	  if [ -f "$(top_srcdir)/$(2)/$(3)$$$$lang.po" ]; \
> +	  then									\
> +	    if ! msgfmt -c "$(top_srcdir)/$(2)/$(3)$$$$lang.po" ; \
> +		then \
> +		  exit 1 ; \
> +	    fi ; \
> +	  fi ;									\

Would be great if you could align backslashes.  :-)

Otherwise LGTM, thanks!

Ludo’.




Reply sent to Julien Lepiller <julien <at> lepiller.eu>:
You have taken responsibility. (Thu, 28 Jan 2021 16:24:02 GMT) Full text and rfc822 format available.

Notification sent to Julien Lepiller <julien <at> lepiller.eu>:
bug acknowledged by developer. (Thu, 28 Jan 2021 16:24:02 GMT) Full text and rfc822 format available.

Message #13 received at 46044-done <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 46044-done <at> debbugs.gnu.org
Subject: Re: bug#46044: [PATCH] Improvements to handling po files
Date: Thu, 28 Jan 2021 17:23:22 +0100
Pushed as c891e7c828d21530f110c04dabe70515447c7d67 and
b91165460e71f427c30f22ace02a5d775ecea23d, thank you!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 26 Feb 2021 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.