unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: "Miguel Ángel Arruga Vivas" <rosen644835@gmail.com>
Cc: 35394@debbugs.gnu.org
Subject: [bug#35394] [PATCH 4/4 v4] Grub i18n
Date: Mon, 19 Oct 2020 15:21:16 +0200	[thread overview]
Message-ID: <87lfg2z703.fsf@gnu.org> (raw)
In-Reply-To: <878sc2phn3.fsf@gmail.com> ("Miguel Ángel Arruga Vivas"'s message of "Mon, 19 Oct 2020 13:41:36 +0200")

Hi,

Miguel Ángel Arruga Vivas <rosen644835@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’.




  reply	other threads:[~2020-10-19 13:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 13:17 [bug#35394] [PATCH 0/3] Bootloader localization Miguel
2019-04-23 13:26 ` [bug#35394] [PATCH 1/3] system: Add locale to boot-parameters Miguel
2019-04-23 13:26 ` [bug#35394] [PATCH 2/3] system: Provide locale information to the bootloader Miguel
2019-04-23 13:26 ` [bug#35394] [PATCH 3/3] system: Use locale information in grub.cfg Miguel
2019-04-26 10:50 ` [bug#35394] [PATCH 3/4] gnu: grub: Add locale output for bootloading Miguel
2019-05-03 12:27   ` Miguel
2019-04-26 10:51 ` [bug#35394] [PATCH 4/4] system: Use locale information in grub.cfg Miguel
2019-05-03 12:27   ` Miguel
2019-04-29  7:56 ` [bug#35394] [PATCH 0/3] Bootloader localization Ludovic Courtès
     [not found]   ` <20191021124035.531bed75@gmail.com>
2019-10-21 10:46     ` [bug#35394] [PATCH 1/3] system: Add locale to boot-parameters Miguel Arruga Vivas
2019-10-21 10:46     ` [bug#35394] [PATCH 2/3] system: Provide locale information to the bootloader Miguel Arruga Vivas
2019-10-21 10:46     ` [bug#35394] [PATCH 3/3] system: Use locale information in grub.cfg Miguel Arruga Vivas
2020-10-11 14:18 ` [bug#35394] [PATCH 1/1 v4] Grub i18n Miguel Ángel Arruga Vivas
2020-10-17 16:32   ` Ludovic Courtès
2020-10-18 15:09     ` [bug#35394] [PATCH 4/4 " Miguel Ángel Arruga Vivas
2020-10-18 15:43       ` Miguel Ángel Arruga Vivas
2020-10-19  8:50         ` Ludovic Courtès
2020-10-19 11:41           ` Miguel Ángel Arruga Vivas
2020-10-19 13:21             ` Ludovic Courtès [this message]
2020-10-19 13:44               ` Miguel Ángel Arruga Vivas
2020-10-20 20:50                 ` Ludovic Courtès
2020-10-20 21:19                   ` bug#35394: " Miguel Ángel Arruga Vivas

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=87lfg2z703.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=35394@debbugs.gnu.org \
    --cc=rosen644835@gmail.com \
    /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).