unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Combine locales
@ 2022-09-24 23:35 Fredrik Salomonsson
  2022-09-25 10:38 ` Sergiu Ivanov
  2022-09-26  9:02 ` Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Fredrik Salomonsson @ 2022-09-24 23:35 UTC (permalink / raw)
  To: help-guix

Hi all,

I'm slowly transition my computers to running Guix System instead Guix
on a foreign distro. Starting with my laptop, as that is not that
critical right now.

One thing I cannot figure out is how to setup the operating-system to
use English as the language but use Swedish for the date format. Similar
to what is described in Locale Names[0] in the libc manual.

I.e. on my foreign distro I have /etc/locale.conf define:
---✀----------------------------------------------------------------------------
LANG=en_US.UTF-8
LC_TIME=sv_SE.UTF-8
--------------------------------------------------------------------------------

In my operating-system configuration system I have:
---✀----------------------------------------------------------------------------
(operating-system
 ;;…
 (locale "en_US.utf8")
 (locale-definitions
  (list
   (locale-definition (name "en_US.utf8") (source "en_US") (charset "UTF-8"))
   (locale-definition (name "sv_SE.utf8") (source "sv_SE") (charset "UTF-8"))))
 ;;…
)
--------------------------------------------------------------------------------

I have checked the guix manual, but cannot find any information about
this. Is it not supported?

[0] https://www.gnu.org/software/libc/manual/html_node/Locale-Names.html

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Combine locales
  2022-09-24 23:35 Combine locales Fredrik Salomonsson
@ 2022-09-25 10:38 ` Sergiu Ivanov
  2022-09-26  2:38   ` Fredrik Salomonsson
  2022-09-26  9:02 ` Ludovic Courtès
  1 sibling, 1 reply; 4+ messages in thread
From: Sergiu Ivanov @ 2022-09-25 10:38 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix

Hi Fredrik,

Fredrik Salomonsson <plattfot@posteo.net> [2022-09-25T01:35:12+0200]:
>
> One thing I cannot figure out is how to setup the operating-system to
> use English as the language but use Swedish for the date format. Similar
> to what is described in Locale Names[0] in the libc manual.
>
> I.e. on my foreign distro I have /etc/locale.conf define:
> ---✀----------------------------------------------------------------------------
> LANG=en_US.UTF-8
> LC_TIME=sv_SE.UTF-8
> --------------------------------------------------------------------------------
>
> In my operating-system configuration system I have:
> ---✀----------------------------------------------------------------------------
> (operating-system
>  ;;…
>  (locale "en_US.utf8")
>  (locale-definitions
>   (list
>    (locale-definition (name "en_US.utf8") (source "en_US") (charset "UTF-8"))
>    (locale-definition (name "sv_SE.utf8") (source "sv_SE") (charset "UTF-8"))))
>  ;;…
> )
> --------------------------------------------------------------------------------

I use a similar definition in operating-system, and I set up additional
locale parameters in my Guix Home configuration, using the
environment-variables field in home-bash-configuration [0].

I think it's fine if you launch everything from a shell, but it will
probably not work if you extensively use a graphical
desktop environment.

-
Sergiu

[0] https://guix.gnu.org/manual/devel/en/html_node/Shells-Home-Services.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Combine locales
  2022-09-25 10:38 ` Sergiu Ivanov
@ 2022-09-26  2:38   ` Fredrik Salomonsson
  0 siblings, 0 replies; 4+ messages in thread
From: Fredrik Salomonsson @ 2022-09-26  2:38 UTC (permalink / raw)
  To: Sergiu Ivanov; +Cc: help-guix

Hi Sergiu,

Sergiu Ivanov <sivanov@colimite.fr> writes:

> Hi Fredrik,
>
> Fredrik Salomonsson <plattfot@posteo.net> [2022-09-25T01:35:12+0200]:
>>
>> One thing I cannot figure out is how to setup the operating-system to
>> use English as the language but use Swedish for the date format. Similar
>> to what is described in Locale Names[0] in the libc manual.
>>
>> I.e. on my foreign distro I have /etc/locale.conf define:
>> ---✀----------------------------------------------------------------------------
>> LANG=en_US.UTF-8
>> LC_TIME=sv_SE.UTF-8
>> --------------------------------------------------------------------------------
>>
>> In my operating-system configuration system I have:
>> ---✀----------------------------------------------------------------------------
>> (operating-system
>>  ;;…
>>  (locale "en_US.utf8")
>>  (locale-definitions
>>   (list
>>    (locale-definition (name "en_US.utf8") (source "en_US") (charset "UTF-8"))
>>    (locale-definition (name "sv_SE.utf8") (source "sv_SE") (charset "UTF-8"))))
>>  ;;…
>> )
>> --------------------------------------------------------------------------------
>
> I use a similar definition in operating-system, and I set up additional
> locale parameters in my Guix Home configuration, using the
> environment-variables field in home-bash-configuration [0].

It did not occur to me to put them in my bash configuration, that's
clever.

> I think it's fine if you launch everything from a shell, but it will
> probably not work if you extensively use a graphical
> desktop environment.
> [0] https://guix.gnu.org/manual/devel/en/html_node/Shells-Home-Services.html

Yeah, I'm launching sway from my bash profile so that worked out well.
However I couldn't use environment-variables, but instead I needed to
put them directly in bash-profile [0]. Otherwise they would be defined
below my snippet for launching sway and not be defined for the sway
session.

It seems to be working now though, e.g. the clock in waybar now shows
the date in Swedish.

Thank you for the help!

[0] https://git.sr.ht/~plattfot/plt/tree/d8ad5f4a41fb607bfd0d890fcaf89990ed1a95ef/item/plt/home/bash.scm

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Combine locales
  2022-09-24 23:35 Combine locales Fredrik Salomonsson
  2022-09-25 10:38 ` Sergiu Ivanov
@ 2022-09-26  9:02 ` Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2022-09-26  9:02 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix

Hi,

Fredrik Salomonsson <plattfot@posteo.net> skribis:

> One thing I cannot figure out is how to setup the operating-system to
> use English as the language but use Swedish for the date format. Similar
> to what is described in Locale Names[0] in the libc manual.
>
> I.e. on my foreign distro I have /etc/locale.conf define:
> ---✀----------------------------------------------------------------------------
> LANG=en_US.UTF-8
> LC_TIME=sv_SE.UTF-8
> --------------------------------------------------------------------------------

I think we’re missing an easy way to configure this.  One way to do it
system-wide would be (untested):

  (simple-service 'locale-setup session-environment-service-type
                  '(("LANG" . "en_US.UTF-8")
                    ("LC_CTIME" . "sv_SE.UTF-8")))

That way, all sessions would get these environment variables by default.

HTH!

Ludo’.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-26  9:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-24 23:35 Combine locales Fredrik Salomonsson
2022-09-25 10:38 ` Sergiu Ivanov
2022-09-26  2:38   ` Fredrik Salomonsson
2022-09-26  9:02 ` Ludovic Courtès

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).