unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Julien Lepiller <julien@lepiller.eu>
Cc: 46044@debbugs.gnu.org
Subject: [bug#46044] [PATCH] Improvements to handling po files
Date: Thu, 28 Jan 2021 15:58:19 +0100	[thread overview]
Message-ID: <87czxpm7lg.fsf@gnu.org> (raw)
In-Reply-To: <20210122213402.1f964c7f@tachikoma.lepiller.eu> (Julien Lepiller's message of "Fri, 22 Jan 2021 21:34:02 +0100")

Hi!

Julien Lepiller <julien@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@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@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	other threads:[~2021-01-28 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 20:34 [bug#46044] [PATCH] Improvements to handling po files Julien Lepiller
2021-01-28 14:58 ` Ludovic Courtès [this message]
2021-01-28 16:23   ` bug#46044: " Julien Lepiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czxpm7lg.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=46044@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).