You are not logged in.

#26 2012-08-31 13:28:05

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [Solved] Cannot set locale (at first)

Make sure you don't have any LOCALE in /etc/rc.conf.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#27 2012-09-03 15:51:52

enricostn
Member
Registered: 2011-08-09
Posts: 57

Re: [Solved] Cannot set locale (at first)

Hi,

it seems I've the same issue here too sad

here is my locale -a

$  locale -a
C
POSIX
en_US.utf8
es_ES.iso885915@euro
es_ES.utf8
es_ES@euro

/etc/locale.conf

$ cat /etc/locale.conf 
LANG=en_US.utf8
LC_COLLATE=C

and my locale

$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

I'm using systemd and no LOCALE informations are stored in /etc/rc.conf

I use the spanish key map, but only in terminal (xterm) the euro symbol doesn't show up, in others applications it works.

Others language specific keys, like ~ñÑ, just works, in terminal too.

I've manually deleted /etc/profile.d/locale.sh file...

I've tried adding $HOME/.config/locale.conf but it doesn't change anything.

Could anyone please help me?

Thank you,

enrico

Offline

#28 2012-09-03 15:58:15

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [Solved] Cannot set locale (at first)

I've manually deleted /etc/profile.d/locale.sh file...

Why the fuck did you do that? Never delete stuff! Always rename it with .bak at the end (backup) or move it somewhere else.

You don't need a "~/.config/locale.conf" file. Just set "LANG=en_US.UTF-8" in /etc/locale.conf (assuming you have uncommented "en_US.UTF-8 UTF-8" and "es_ES.UTF-8 UTF-8" from /etc/locale.gen and ran "sudo locale-gen").

Last edited by DSpider (2012-09-03 15:58:31)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#29 2012-09-03 16:04:25

enricostn
Member
Registered: 2011-08-09
Posts: 57

Re: [Solved] Cannot set locale (at first)

DSpider wrote:

I've manually deleted /etc/profile.d/locale.sh file...

Why the fuck did you do that? Never delete stuff! Always rename it with .bak at the end (backup) or move it somewhere else.

ya... ¬¬

DSpider wrote:

You don't need a "~/.config/locale.conf" file. Just set "LANG=en_US.UTF-8" in /etc/locale.conf (assuming you have uncommented "en_US.UTF-8 UTF-8" and "es_ES.UTF-8 UTF-8" from /etc/locale.gen and ran "sudo locale-gen").

It's what I've done, see my locale.conf file above... but it doesn't work.

Offline

#30 2012-09-03 17:38:27

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [Solved] Cannot set locale (at first)

Of course it doesn't work. Because "locale.sh" is supposed to load it after logging in.

Put it back the way it was.

$ cat /etc/profile.d/locale.sh
#!/bin/sh

unset LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES \
      LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION

if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
  . "$XDG_CONFIG_HOME/locale.conf"
elif [ -n $HOME ] && [ -r $HOME/.config/locale.conf ]; then
  . "$HOME/.config/locale.conf"
elif [ -r /etc/locale.conf ]; then
  . /etc/locale.conf
elif [ -r /etc/rc.conf ]; then
  LANG=$(. /etc/rc.conf 2>/dev/null; echo "$LOCALE")
fi

export LANG="${LANG:-C}"
[ -n "$LC_CTYPE" ]          && export LC_CTYPE
[ -n "$LC_NUMERIC" ]        && export LC_NUMERIC
[ -n "$LC_TIME" ]           && export LC_TIME
[ -n "$LC_COLLATE" ]        && export LC_COLLATE
[ -n "$LC_MONETARY" ]       && export LC_MONETARY
[ -n "$LC_MESSAGES" ]       && export LC_MESSAGES
[ -n "$LC_PAPER" ]          && export LC_PAPER
[ -n "$LC_NAME" ]           && export LC_NAME
[ -n "$LC_ADDRESS" ]        && export LC_ADDRESS
[ -n "$LC_TELEPHONE" ]      && export LC_TELEPHONE
[ -n "$LC_MEASUREMENT" ]    && export LC_MEASUREMENT
[ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION

"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#31 2012-09-03 20:07:00

enricostn
Member
Registered: 2011-08-09
Posts: 57

Re: [Solved] Cannot set locale (at first)

DSpider wrote:

Of course it doesn't work. Because "locale.sh" is supposed to load it after logging in.

Put it back the way it was.

ehm.. thank you... I'll never ever delete a system file. I promise.

bye,

enrico

Offline

#32 2012-09-03 20:37:36

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [Solved] Cannot set locale (at first)

$ pacman -Qo /etc/profile.d/locale.sh
/etc/profile.d/locale.sh is owned by filesystem 2012.8-1

But don't reinstall filesystem, unless you want your /etc/fstab to be overwritten (which would be bad). You can build any package from the official repositories with ABS in order to obtain the source code or some default configuration file:

# pacman -S abs
# abs
$ cp -a /var/abs/core/filesystem/ ~/.builds/
$ cd ~/.builds/
$ makepkg -s
# cp ~/.builds/filesystem/pkg/etc/profile.d/locale.sh /etc/profile.d/locale.sh

It's the same one I posted (it's from my system).


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#33 2013-05-16 19:27:48

gauthma
Member
Registered: 2010-02-16
Posts: 215
Website

Re: [Solved] Cannot set locale (at first)

I know it's against forum policy to "resurrect" old threads, but I wanted to close this one with a definitive reason: my initial problem -- locale not being set -- was because one of the scripts in /etc/profile.d/ did an exec, and that prevented locale.sh from running (the script was sourced before locale.sh).

The reason why this took so long to figure out was because I had (and have) a workaround, so I never really looked into it (in fairness, I thought the problem was related to systemd, and not the shell scripts). Until now, when I had to install arch on a new machine.

A (long overdue) thanks for all the feedback! smile

Last edited by gauthma (2013-05-16 19:35:59)

Offline

#34 2013-07-20 01:41:06

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [Solved] Cannot set locale (at first)

Closed.  Split diverging topic off to a new thread.  Follow the discussion here


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB