You are not logged in.

#1 2019-02-26 13:45:42

hlappal
Member
Registered: 2019-02-26
Posts: 6

[SOLVED] Setting the locale right with non-english keyboard

Hi,

I have Arch running with XFCE desktop environment, and LightDM display manager. I want my system to be in English, but I'm using a nordic keyboard (Finnish, to be precise).

In my /etc/locale.conf I have

LANG=en_US.UTF-8
LC_CTYPE=fi_FI.UTF-8

but when I run 'locale', I get

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=fi_FI.ISO-8859-1
LC_CTYPE=fi_FI.ISO-8859-1
LC_NUMERIC="fi_FI.ISO-8859-1"
LC_TIME="fi_FI.ISO-8859-1"
LC_COLLATE="fi_FI.ISO-8859-1"
LC_MONETARY="fi_FI.ISO-8859-1"
LC_MESSAGES=C
LC_PAPER="fi_FI.ISO-8859-1"
LC_NAME="fi_FI.ISO-8859-1"
LC_ADDRESS="fi_FI.ISO-8859-1"
LC_TELEPHONE="fi_FI.ISO-8859-1"
LC_MEASUREMENT="fi_FI.ISO-8859-1"
LC_IDENTIFICATION="fi_FI.ISO-8859-1"
LC_ALL=

I have defined the fi_FI.ISO-8859-1 locale somewhere at some point, but I can't find it anymore.

Also, with 'localectl', I get

System Locale: LANG=en_US.UTF-8
                          LC_CTYPE=fi_FI.UTF-8
     VC Keymap: fi
      X11 Layout: n/a

This is not currently a major problem, but it bothers me. Also in my LightDM greeter, on the top bar, there is an icon that shows that the keyboard layout is US. Fortunately, I don't have any nordic characters in my password, but I would like to get this fixed. My ~/.dmrc is

[Desktop]
Language=fi_FI.UTF-8
Session=xfce

Has anyone else had similar problems, and can you help me?

Last edited by hlappal (2019-02-26 15:45:38)

Offline

#2 2019-02-26 13:59:41

mountaineerbr
Banned
Registered: 2018-12-08
Posts: 48

Re: [SOLVED] Setting the locale right with non-english keyboard

You are changing the default, global Languages. It may have been you edited user custom ~/.config/locale.conf for those fi settings...

Minor issue is to keep those settings all homogenous, for e.g. in your custom local  LC_CTYPE=fi_FI.ISO-8859-1 , you do not use open and close "double-quotes" for the type, whereas in the other options you do...

Plus, in your global LC_CTYPE=fi_FI.UTF-8  , why is it different from "fi_FI.ISO-8859-1" which seems to work?

Also, you did not set LC_ALL, so you may just as well delete that entry.

There seems to be a little misunderstanding, I reckon locale has to do with date format, hour format, use of colon or final stop marks in numbers.. I don't think it has something to do with keyboard layout directly, But i am not 100%  sure about that!

Last edited by mountaineerbr (2019-02-26 14:08:49)

Offline

#3 2019-02-26 14:12:32

hlappal
Member
Registered: 2019-02-26
Posts: 6

Re: [SOLVED] Setting the locale right with non-english keyboard

Ok, I had totally forgotten that local config file. Now I changed it from

LANG=fi_FI.ISO-8859-1
LC_CTYPE=fi_FI.ISO-8859-1
LC_MESSAGE=fi_FI.ISO-8859-1

to

LANG=fi_FI.UTF-8
LC_CTYPE=fi_FI.UTF-8
LC_MESSAGE=fi_FI.UTF-8

but nothing seem to have changed. I still get the same output with 'locale' and 'localectl' (after re-login), and the keyboard layout for LightDM is still US. I have never written all those fi_FI.ISO-8859-1 lines on any file, so they are generated automatically from somewhere. Is this an issue of XFCE?

Edit:

I don't even know which file contains those .ISO-8859-1 lines. How would I check that?

Last edited by hlappal (2019-02-26 14:31:18)

Offline

#4 2019-02-26 14:39:22

mountaineerbr
Banned
Registered: 2018-12-08
Posts: 48

Re: [SOLVED] Setting the locale right with non-english keyboard

Did you make the change in the global locale.conf from

LC_CTYPE=fi_FI.UTF-8

to

LC_CTYPE=fi_FI.ISO-8859-1

?

System will read the global conf first and then your local conf... As your local locale.conf is well configured, it does not matter if the global settings are returning warnings..

===========================================
As you mentioned that it was not yourself that set any "fi_FI.ISO-8859-1", so why don't you go ahead and change all settings to "en_US.UTF-8", supposing you want all configurations set to US standards?

*Make backups!

For example, in /etc/locale.conf, only:

LANG=en_US.UTF-8

And then in ~/.config/locale.conf you might start with:

 
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

===========================================

Locales does not have anything to do with keyboard layout?

To change keyboard layout you must hack away at:

XFCE -- > All Settings -- > Keyboard -- > Layout

Though, I have no idea how LightDM  works or how to set up keyboard layout at the login DE chooser.

===========================================

It is very important you log out and then log in again... You cannot keep logged in any session otherwise it won't work.
When I change system settings, I usually keep rebooting until all changes are made ...

===========================================

The only reason to really set a custom locale.conf is if you want your system to be in a certain language but date and time formats in another.
In my system, for example, my global locale.conf is set to  LANG=en_US.UTF-8 only, and then custom locale.conf I set all other things

LANG=en_GB.UTF-8
LC_NUMERIC="pt_BR.UTF-8"
LC_TIME="pt_BR.UTF-8"
LC_MONETARY="pt_BR.UTF-8"
LC_PAPER="pt_BR.UTF-8"
LC_NAME="pt_BR.UTF-8"
LC_ADDRESS="pt_BR.UTF-8"
LC_TELEPHONE="pt_BR.UTF-8"
LC_MEASUREMENT="pt_BR.UTF-8"

PS: I hope to have helped and not confused you even more!

Last edited by mountaineerbr (2019-02-26 14:40:27)

Offline

#5 2019-02-26 15:10:51

hlappal
Member
Registered: 2019-02-26
Posts: 6

Re: [SOLVED] Setting the locale right with non-english keyboard

Thanks, this makes everything a bit clearer. I set my global config to LANG=en_US.UTF-8 only, and make all the other configs on .config/locale.conf. This works perfectly for XFCE at least. I also have my

 XFCE --> Settings --> Keyboard --> Layout 

set to Finnish.

But unfortunately, my initial problems are still present: 'locale' output is still

LANG=fi_FI.ISO-8859-1
LC_CTYPE=fi_FI.ISO-8859-1
LC_NUMERIC="fi_FI.ISO-8859-1"
LC_TIME="fi_FI.ISO-8859-1"
LC_COLLATE="fi_FI.ISO-8859-1"
LC_MONETARY="fi_FI.ISO-8859-1"
LC_MESSAGES=C
LC_PAPER="fi_FI.ISO-8859-1"
LC_NAME="fi_FI.ISO-8859-1"
LC_ADDRESS="fi_FI.ISO-8859-1"
LC_TELEPHONE="fi_FI.ISO-8859-1"
LC_MEASUREMENT="fi_FI.ISO-8859-1"
LC_IDENTIFICATION="fi_FI.ISO-8859-1"
LC_ALL=

all though it doesn't seem to have an effect on anything.

Also, my LightDM greeter still seems to use US keymap. This doesn't seem to be affected either by global or local configs.

Offline

#6 2019-02-26 15:19:59

seth
Member
Registered: 2012-09-03
Posts: 56,506

Re: [SOLVED] Setting the locale right with non-english keyboard

The keyboard sessings have nothing to do w/ the locale (at least not directly)
Do you have the iso8859 locale also when you log in
a) on the console (no lightdm, no gui)?
b) on the console as root?

As for the keyboard, "setxkbmap fi", I've no idea whether xfce or lightdm have gui configs for that, but you could add it to the startup scripts.
https://wiki.archlinux.org/index.php/LightDM#Keymap - but I've zero experience on lightdm.

Offline

#7 2019-02-26 15:25:10

mountaineerbr
Banned
Registered: 2018-12-08
Posts: 48

Re: [SOLVED] Setting the locale right with non-english keyboard

OK, now I get it... Fi is for Finnish! I am sorry for any misunderstanding

Your locale output looks fine now, no more warnings of something not found!
You can ultimately set your system lang to Finnish, too. Not sure if that "solves" anything..

also, this:
https://unix.stackexchange.com/question … in-lightdm

I will leave it here. Hope someone helps you out to set up your LightDM keyboard layout!

Last edited by mountaineerbr (2019-02-26 15:45:23)

Offline

#8 2019-02-26 15:38:45

hlappal
Member
Registered: 2019-02-26
Posts: 6

Re: [SOLVED] Setting the locale right with non-english keyboard

In console (tty2) my keymap works fine (Finnish, just as I wanted), both as my user and as root. So it is my system keymap? Weird that its still not working on the greeter...

Edit:

I figured it out!

As my 'localectl' output said that X11 Layout was n/a, I used the command

localectl set-x11-keymap fi

and now also the LightDM greeter has the correct keymap.

Thanks for your answers! They really helped.

Last edited by hlappal (2019-02-26 15:41:11)

Offline

Board footer

Powered by FluxBB