unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Miguel Ángel Arruga Vivas" <rosen644835@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>,
	Mathieu Othacehe <othacehe@gnu.org>,
	Brendan Tildesley <mail@brendan.scot>
Subject: Re: Localization of language names
Date: Sat, 17 Oct 2020 13:46:35 +0200	[thread overview]
Message-ID: <87zh4lqdlw.fsf@gmail.com> (raw)
In-Reply-To: <874kmzr4u7.fsf@gnu.org> ("Ludovic Courtès"'s message of "Mon, 12 Oct 2020 14:44:48 +0200")


[-- Attachment #1.1: Type: text/plain, Size: 1380 bytes --]

Hi,

Ludovic Courtès <ludo@gnu.org> writes:
> Brendan Tildesley <mail@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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-installer-Call-setlocale-after-init-gettext.patch --]
[-- Type: text/x-patch, Size: 960 bytes --]

From 69b8d919a802d72fca218b7dfd9e7719c4711544 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
 <rosen644835@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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]

  reply	other threads:[~2020-10-17 11:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11  6:23 Call for 1.2 installer testing Brendan Tildesley
2020-10-11  9:48 ` Efraim Flashner
2020-10-11 20:32 ` pelzflorian (Florian Pelz)
2020-10-11 20:36   ` Marinus Savoritias
2020-10-11 23:40   ` Brendan Tildesley
2020-10-13  6:47   ` Brendan Tildesley
2020-10-13  6:50   ` Brendan Tildesley
2020-10-12 12:44 ` Localization of language names Ludovic Courtès
2020-10-17 11:46   ` Miguel Ángel Arruga Vivas [this message]
2020-10-21 13:26     ` Ludovic Courtès

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=87zh4lqdlw.fsf@gmail.com \
    --to=rosen644835@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=mail@brendan.scot \
    --cc=othacehe@gnu.org \
    /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).