From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 22 15:34:24 2021 Received: (at submit) by debbugs.gnu.org; 22 Jan 2021 20:34:24 +0000 Received: from localhost ([127.0.0.1]:33252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l338R-0002jM-PG for submit@debbugs.gnu.org; Fri, 22 Jan 2021 15:34:24 -0500 Received: from lists.gnu.org ([209.51.188.17]:56820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l338Q-0002jE-7B for submit@debbugs.gnu.org; Fri, 22 Jan 2021 15:34:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l338P-0000k3-MX for guix-patches@gnu.org; Fri, 22 Jan 2021 15:34:21 -0500 Received: from lepiller.eu ([2a00:5884:8208::1]:57738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l338M-00064s-GX for guix-patches@gnu.org; Fri, 22 Jan 2021 15:34:21 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 37d620d9 for ; Fri, 22 Jan 2021 20:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=s3M C9oMcC7IfY5BokMOyeDQy69yldp8hz18tMEdj1aI=; b=D1t5zKh6LhVPfNHpOVc K1exYLvPdvzzR/yePlEFDEpfR/66VrYO+ccyCaM+DIkLMSMib9BdIuJRGdAcbf+S 7wIfuQBcyG8LYlgxmSMlg4M2OwdFUm2R87yVcTl75eqAdFNvQ4NSoWHRxyUFEpli 1yWgw91Qd1GWxAhiUIAVzlse1xQG85NH4M9Ktz9W+60HfZeqQvgJ8xSHZvFcpSWv XJZ9hCi/SG/Nc7mAwjmv8SesrYOjkeuVj1qIwsgz9oqlodEbZUzP7PmqQ/gV0Pwu vhjluNHVrgdvS6+b8q3WIDu9KRhkT5DepSH7Nbv9PGNocCVke2gaFe3xnxqJpDAq 9gQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3f8a0cdb (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Fri, 22 Jan 2021 20:34:10 +0000 (UTC) Date: Fri, 22 Jan 2021 21:34:02 +0100 From: Julien Lepiller To: guix-patches@gnu.org Subject: [PATCH] Improvements to handling po files Message-ID: <20210122213402.1f964c7f@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/SvctapDPLZGWhqf7fQ3.Jck" Received-SPF: pass client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --MP_/SvctapDPLZGWhqf7fQ3.Jck Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: 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. --MP_/SvctapDPLZGWhqf7fQ3.Jck Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-Makefile.am-Normalize-downloaded-po-files.patch >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. --- Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 8a8133d669..d479032f83 100644 --- a/Makefile.am +++ b/Makefile.am @@ -990,7 +990,10 @@ download-po.$(1): if wget -nv -O "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \ "https://translate.fedoraproject.org/api/translations/guix/$(1)/$$$$lang/file/" ; \ then \ - mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp,} ; \ + msgfilter --no-wrap -i "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \ + cat > "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp2" ; \ + rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \ + mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp2,} ; \ else \ rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \ fi ; \ -- 2.30.0 --MP_/SvctapDPLZGWhqf7fQ3.Jck Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-Makefile.am-Add-check-po-rule.patch >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. --- Makefile.am | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Makefile.am b/Makefile.am index d479032f83..371fc42394 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1003,14 +1003,46 @@ download-po.$(1): endef +# make-check-po-rule DOMAIN DIRECTORY [FILE-NAME-PREFIX] +define make-check-po-rule + +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 ; \ + done + +.PHONY: check-po.$(1) + +endef + $(eval $(call make-download-po-rule,documentation-cookbook,po/doc,guix-cookbook.)) $(eval $(call make-download-po-rule,documentation-manual,po/doc,guix-manual.)) $(eval $(call make-download-po-rule,guix,po/guix)) $(eval $(call make-download-po-rule,packages,po/packages)) +$(eval $(call make-check-po-rule,documentation-cookbook,po/doc,guix-cookbook.)) +$(eval $(call make-check-po-rule,documentation-manual,po/doc,guix-manual.)) +$(eval $(call make-check-po-rule,guix,po/guix)) +$(eval $(call make-check-po-rule,packages,po/packages)) + download-po: $(foreach domain,guix packages documentation-manual documentation-cookbook,download-po.$(domain)) .PHONY: download-po +check-po: $(foreach domain,guix packages documentation-manual documentation-cookbook,check-po.$(domain)) +.PHONY: check-po + ## -------------- ## ## Silent rules. ## ## -------------- ## -- 2.30.0 --MP_/SvctapDPLZGWhqf7fQ3.Jck-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 28 09:58:33 2021 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: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#46044: [PATCH] Improvements to handling po files 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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46044 Cc: 46044@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 28 11:23:37 2021 Received: (at 46044-done) by debbugs.gnu.org; 28 Jan 2021 16:23:38 +0000 Received: from localhost ([127.0.0.1]:49642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5A53-0003YC-OV for submit@debbugs.gnu.org; Thu, 28 Jan 2021 11:23:37 -0500 Received: from lepiller.eu ([89.234.186.109]:55766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5A4z-0003Xt-UD for 46044-done@debbugs.gnu.org; Thu, 28 Jan 2021 11:23:36 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 28e2ee15; Thu, 28 Jan 2021 16:23:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=pnytYBNcG8NU I/w6D+10DqynImfpr3S4uwdqXHerbvo=; b=Zo8gP0HViyp67ZeCI1lu1wpim0/a tF7vhqgU4D5gi86rtDUFUWuUlM3YuPeSzQqCK1oDFy+qyRl81phEL+JpgfDsMnjO VDnZFfFzKJlnIzV9C66rmpVCKX3DRAiMBoQDSMHurqtAoxEA+EZnW04GL9olhuGY jZdYhw/MmQagRwplDdrQAKlnKPtWmOWpCRBxoNE//TWUTfrbRaI32AWnv79kLLR7 iGWmP6zkr/nBa10LRisU8jwHuLmPk5I/0/ec6dbsRq6KC6y6qXLBPzWkV06qf1RN 156AOkJesdvavHXSSvxeonVNLWLcc6A80VtJgyWm888m0ebA+Rc1STLyGA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id abeb534d (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 28 Jan 2021 16:23:31 +0000 (UTC) Date: Thu, 28 Jan 2021 17:23:22 +0100 From: Julien Lepiller To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: bug#46044: [PATCH] Improvements to handling po files Message-ID: <20210128172322.684c72a9@tachikoma.lepiller.eu> In-Reply-To: <87czxpm7lg.fsf@gnu.org> References: <20210122213402.1f964c7f@tachikoma.lepiller.eu> <87czxpm7lg.fsf@gnu.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 46044-done Cc: 46044-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Pushed as c891e7c828d21530f110c04dabe70515447c7d67 and b91165460e71f427c30f22ace02a5d775ecea23d, thank you! From unknown Wed Aug 20 02:46:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 26 Feb 2021 12:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator