From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aF0zFkTREmAMWwAA0tVLHw (envelope-from ) for ; Thu, 28 Jan 2021 14:59:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8BoGEkTREmAzagAAbx9fmQ (envelope-from ) for ; Thu, 28 Jan 2021 14:59:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C0A429403A4 for ; Thu, 28 Jan 2021 14:59:15 +0000 (UTC) Received: from localhost ([::1]:38276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58lO-0005j5-IH for larch@yhetil.org; Thu, 28 Jan 2021 09:59:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58lD-0005gV-2C for guix-patches@gnu.org; Thu, 28 Jan 2021 09:59:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58lC-0005BU-5G for guix-patches@gnu.org; Thu, 28 Jan 2021 09:59:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l58lC-0001AS-54 for guix-patches@gnu.org; Thu, 28 Jan 2021 09:59:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46044] [PATCH] Improvements to handling po files Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Jan 2021 14:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46044 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller Received: via spool by 46044-submit@debbugs.gnu.org id=B46044.16118459134447 (code B ref 46044); Thu, 28 Jan 2021 14:59:02 +0000 Received: (at 46044) by debbugs.gnu.org; 28 Jan 2021 14:58:33 +0000 Received: from localhost ([127.0.0.1]:49353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l58ki-00019e-Ri for submit@debbugs.gnu.org; Thu, 28 Jan 2021 09:58:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l58ke-00019N-QI for 46044@debbugs.gnu.org; Thu, 28 Jan 2021 09:58:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43459) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58kY-0004xo-Hp; Thu, 28 Jan 2021 09:58:22 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=58280 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l58kX-0007lY-0y; Thu, 28 Jan 2021 09:58:21 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210122213402.1f964c7f@tachikoma.lepiller.eu> Date: Thu, 28 Jan 2021 15:58:19 +0100 In-Reply-To: <20210122213402.1f964c7f@tachikoma.lepiller.eu> (Julien Lepiller's message of "Fri, 22 Jan 2021 21:34:02 +0100") Message-ID: <87czxpm7lg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 46044@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.85 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C0A429403A4 X-Spam-Score: -2.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: AEYkKFTmBV16 Hi! Julien Lepiller 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 =E2=80=9Cmake as-derivation=E2=80=9D (sometimes just =E2=80= =9Cmake=E2=80=9D isn=E2=80=99t enough to catch issues it seems, not sure why.) >>>From 42aa42512dba281f3d33e7883c922c0f5704bee4 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > 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 > 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=3D"`grep -v '^[[:blank:]]*#' < $(top_srcdir)/$(2)/LINGUAS`" ;= \ > + else \ > + LINGUAS=3D"`(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=E2=80=99.