Hi,

Ludovic Courtès <l...@gnu.org> writes:
> Brendan Tildesley <m...@brendan.scot> skribis:
>
>> Languages listed in the language selection are sometimes in English,
>> Rarely in the native language.
>
> We take language names and their translations from the ‘iso-codes’
> package, specifically the “iso_639-3” message catalog.  Quoth
> (gnu installer newt locale):
>
>     (lambda (language)
>       (let ((english (language-code->language-name iso639-languages
>                                                    language)))
>         (setenv "LANGUAGE" language)
>         (let ((native (gettext english "iso_639-3")))
>           (unsetenv "LANGUAGE")
>           native)))

Yesterday I took a look at this issue and the problem was that the
installed locale during these calls to gettext was the default one: C.
I've attached a patch that fixes this and now the installer shows
language names in the language itself.

Nonetheless, it didn't work when I removed the call from installer to
installer-real, as the there comment says, and set the locale directly
in the line added by the patch.  Therefore I need to take a deeper look
into libc code to really understand what's happening there, and check if
it is possible to remove that extra call in the future, or find a
satisfactory explanation at least.

Happy hacking!
Miguel

From 69b8d919a802d72fca218b7dfd9e7719c4711544 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
 <rosen644...@gmail.com>
Date: Fri, 16 Oct 2020 15:02:00 +0200
Subject: [PATCH] installer: Call setlocale after init gettext.

* gnu/installer.scm (installer-program)[init-gettext]: Change locale
from C, installed at the program start.
---
 gnu/installer.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/installer.scm b/gnu/installer.scm
index c582a46c14..f401b242f8 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -308,7 +308,8 @@ selected keymap."
     ;; translated.
     #~(begin
         (bindtextdomain "guix" (string-append #$guix "/share/locale"))
-        (textdomain "guix")))
+        (textdomain "guix")
+        (setlocale LC_ALL "")))
 
   (define set-installer-path
     ;; Add the specified binary to PATH for later use by the installer.
-- 
2.28.0

Attachment: signature.asc
Description: PGP signature

Reply via email to