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 4NFwDwOTjV/ldAAA0tVLHw (envelope-from ) for ; Mon, 19 Oct 2020 13:22:11 +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 SKZHCwOTjV93GgAAbx9fmQ (envelope-from ) for ; Mon, 19 Oct 2020 13:22:11 +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 82A30940105 for ; Mon, 19 Oct 2020 13:22:10 +0000 (UTC) Received: from localhost ([::1]:34096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUV73-00062P-Ch for larch@yhetil.org; Mon, 19 Oct 2020 09:22:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUV6w-00062D-TN for guix-patches@gnu.org; Mon, 19 Oct 2020 09:22:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUV6w-0004QW-Jo for guix-patches@gnu.org; Mon, 19 Oct 2020 09:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUV6w-0005Hl-Gb for guix-patches@gnu.org; Mon, 19 Oct 2020 09:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 13:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35394 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Cc: 35394@debbugs.gnu.org Received: via spool by 35394-submit@debbugs.gnu.org id=B35394.160311368620258 (code B ref 35394); Mon, 19 Oct 2020 13:22:02 +0000 Received: (at 35394) by debbugs.gnu.org; 19 Oct 2020 13:21:26 +0000 Received: from localhost ([127.0.0.1]:40237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUV6L-0005Gg-TX for submit@debbugs.gnu.org; Mon, 19 Oct 2020 09:21:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUV6K-0005GU-JI for 35394@debbugs.gnu.org; Mon, 19 Oct 2020 09:21:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33883) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUV6F-0004MZ-BF; Mon, 19 Oct 2020 09:21:19 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=34042 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kUV6E-0004Q2-S1; Mon, 19 Oct 2020 09:21:19 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190423151702.05258473@gmail.com> <87ft6k7sn2.fsf@gmail.com> <87362c6cew.fsf@gnu.org> <87v9f7po4x.fsf_-_@gmail.com> <87o8kzpmjv.fsf@gmail.com> <87o8ky1tx6.fsf@gnu.org> <878sc2phn3.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 19 Oct 2020 15:21:16 +0200 In-Reply-To: <878sc2phn3.fsf@gmail.com> ("Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas"'s message of "Mon, 19 Oct 2020 13:41:36 +0200") Message-ID: <87lfg2z703.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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 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-Spam-Score: -1.51 X-TUID: 7+FWW0mnakBu Hi, Miguel =C3=81ngel Arruga Vivas skribis: >> (Brainstorm=E2=80=A6) >> >> I would simply translate it on the client side by temporarily setting >> LANGUAGE to the target locale. The downside is that this will not be >> translated if the target locale is not supported by the host. >> >> Alternately, we could have: >> >> (define (formatted-i18n-string locale fmt . args) >> (computed-file "formatted-i18n-string" >> #~(begin >> (textdomain =E2=80=A6) >> (setlocale =E2=80=A6) >> (call-with-output-file #$output >> (lambda (port) >> (format port =E2=80=A6)))))) > > I'd prefer this option, as it avoids triggering the translation on the > client side, and it could be used in other places too if needed. It > needs xgettext support and a tag (like F_ or L_) would be very concise, > and useful from my point of view. That=E2=80=99s OK, we can do (as we did in other places) something like: (define-syntax formatted-i18n-string (syntax-rules (G_ N_) ((_ locale (G_ fmt) args ...) (%formatted-i18n-string locale fmt args ...)) =E2=80=A6)) That way, xgettext is happy. > There are some other places (e.g. gnu/machine/ssh.scm:395) which use > string-append for user visible strings[1]. They should be localized > with a proper format, and including the format call into the i18n call > itself helps to ensure that. Yup! >> We would then need to adjust all bootloaders to read the label from that >> file. If the user-supplied =E2=80=98label=E2=80=99 is a plain string, w= e=E2=80=99d wrap it in >> (plain-file =E2=80=A6) so that =E2=80=98label=E2=80=99 is always a file-= like object. > > I'll probably raise some questions about the design here and there, and > maybe open another thread for the point before, but as soon as I have > anything tangible, I'll send a patch. :-) Sure! We may end up delaying that post-release if there=E2=80=99s potential for breakage. We=E2=80=99ll see. Thanks! Ludo=E2=80=99.