GNU bug report logs - #35394
[PATCH 0/3] Bootloader localization

Previous Next

Package: guix-patches;

Reported by: Miguel <rosen644835 <at> gmail.com>

Date: Tue, 23 Apr 2019 13:18:02 UTC

Severity: normal

Tags: patch

Done: Miguel Ángel Arruga Vivas <rosen644835 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Miguel Ángel Arruga Vivas <rosen644835 <at> gmail.com>
Cc: 35394 <at> debbugs.gnu.org
Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n
Date: Mon, 19 Oct 2020 15:21:16 +0200
Hi,

Miguel Ángel Arruga Vivas <rosen644835 <at> gmail.com> skribis:

>> (Brainstorm…)
>>
>> 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 …)
>>                        (setlocale …)
>>                        (call-with-output-file #$output
>>                          (lambda (port)
>>                            (format port …))))))
>
> 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’s 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 ...))
      …))

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 ‘label’ is a plain string, we’d wrap it in
>> (plain-file …) so that ‘label’ 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’s potential for
breakage.  We’ll see.

Thanks!

Ludo’.




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

Previous Next


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