Locale

Revision as of 12:33, 28 February 2018 by imported>Fhdk (→‎More info)

Locale

Locale is defined as your display language and your locations preference for time and date display, monetary layout, paper size and several other location specifics.

At least three locale definitions is used, kernel, X11, and KDE.

Kernel

The kernel locale is controlled by the files

/etc/locale.gen
/etc/locale.conf
/etc/vconsole.conf

locale.gen

The file locale.gen contains information on all available translations for the kernel. All lines are commented by default, and you only remove the comment from those you want to use.

After you have chosen the languages you must save the file and generate the translations for the system to find and use them. The change will only take effect after a restart. The translation files are generated by the command

sudo locale-gen

locale.conf

The file locale.conf contains information on your TTY language and possibly other location specifics.

The available settings are

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

Our chinese users sometimes faces difficulties getting the settings right so with the help of such user we have put together a sample configuration. It is a sample but you get the idea and you can adapt it to you specific needs. The only thing to change is the ISO locale code to match that of your location

Sample locale.conf

 LANG=zh_TW.UTF-8
 LANGUAGE=zh_TW:en_AU
 LC_ADDRESS=en_AU.UTF-8
 LC_IDENTIFICATION=en_AU.UTF-8
 LC_MEASUREMENT=en_AU.UTF-8
 LC_MONETARY=en_AU.UTF-8
 LC_MESSAGES=zh_TW.UTF-8
 LC_NAME=en_AU.UTF-8
 LC_NUMERIC=en_AU.UTF-8
 LC_PAPER=en_AU.UTF-8
 LC_TELEPHONE=en_AU.UTF-8
 LC_TIME=en_AU.UTF-8

vconsole.conf

The file vconsole.conf holds information on your keyboard layout and the font displayed in the TTY - the physical console.

Sample vconsole.conf

Sample setup for danish keyboard and font.

KEYMAP=dk
FONT=ter-118n

X11

For each user on a graphical system you will find a file in the homefolder named ~/.xprofile. This file can be used to control which interface language the X system should use.

Our chinese friend has kindly provided the settings he is using to get his interface right and the settings is provided in the hope they will be useful. It is a sample and as such you might need to adapt them to your location and preference.

# Set display language to zh_TW and gcin as default IM
export LANG=zh_TW.UTF-8
export LANGUAGE=zh_TW:en_AU
export LC_MESSAGES=zh_TW.UTF-8
export LC_CTYPE=zh_TW.UTF-8
export XMODIFIERS=@im=gcin
export GTK_IM_MODULE=gcin
export QT_IM_MODULE=gcin
export XIM_MODULE=gcin

KDE

Generally you should not need any tweaking but for your info, you can define regional settings in the settings manager and they are saved in the file

~/.config/plasma-localerc

Plasma exports the settings using

~/.config/plasma-locale-settings.sh

More info

How to change GUI settings Manjaro Forum

One distinct language per user Manjaro Forum

Locale Arch Linux Wiki