Difference between revisions of "Locale"

182 bytes removed ,  6 years ago
A proper guide for setting locale after some strange issues raised at the forum
imported>Fhdk
imported>Petsam
(A proper guide for setting locale after some strange issues raised at the forum)
Line 3: Line 3:
= Locale =
= 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.
The locale is all the settings related to localization, like language, time, currency etc.
In Manjaro you can set the desired locale settings with Manjaro Settings Manager GUI application.
Sometimes, because of complicated setups and often after some user mistakes, you might not be able to have the correct settings for each user. Below you will see how you can check and set properly your configuration manually.


At least three locale definitions is used, kernel, X11, and KDE.
In Linux systems all locales are available for installation, they just need to be activated/generated. The settings are configured initially system-wide, but it is possible to override them for user-session.
 
== 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


== System ==
Check your current system settings (type in terminal)
<pre>
locale
</pre>
Check which are already active
<pre>
locale -a
</pre>
If your locale is not listed, you must edit '''/etc/locale.gen''' and uncomment yours. In example '''LANG=zh_TW.UTF-8'''
<pre>
# zh_SG.UTF-8 UTF-8
# zh_TW BIG5
# zh_TW.EUC-TW EUC-TW
zh_TW.UTF-8 UTF-8
# zu_ZA ISO-8859-1
</pre>
You may want to uncomment all the variations of your country code "zh_TW" to use them as fallbacks for some programs they might use them. Then, generate them with this command
<pre>
sudo locale-gen
</pre>
Now you can set the system locale with this
<pre>
<pre>
LANG
sudo localectl set-locale LANG=zh_TW.UTF-8
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
</pre>
</pre>
 
The settings are set in the system file '''/etc/locale.conf'''. You don't need to manually edit this file unless you are having troubles.  
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
Here is a sample
 
==== Sample locale.conf ====


<pre>
<pre>
Line 62: Line 52:
</pre>
</pre>


=== vconsole.conf ===
== User ==
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.
 
<pre>
KEYMAP=dk
FONT=ter-118n
</pre>
 
== 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.
 
This sample illustrates how to set Traditional Chinese as the UI language while keeping Australian English for the formats.


The system locale can be overriden for a user that wants a different locale language by creating (or editing if it already exists) a file named `.xprofile` in the home folder `/home/USERNAME/.xprofile`. Edit it with any user specific locale settings as bellow.
This sample illustrates how to set Traditional Chinese as the UI language while keeping Australian English for the formats.
<pre>
<pre>
# Set display language to zh_TW and gcin as default IM
# Set display language to zh_TW and gcin as default IM
Line 92: Line 68:
</pre>
</pre>


== KDE ==
== Console fonts ==
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
The file '''vconsole.conf''' holds information on your keyboard layout and the font displayed in the TTY - the physical console.


~/.config/plasma-localerc
Here is a sample setup for danish keyboard and font.


Plasma exports the settings using
<pre>
 
KEYMAP=dk
~/.config/plasma-locale-settings.sh
FONT=ter-118n
 
</pre>
= More info =
 
[https://forum.manjaro.org/t/request-add-correct-language-setting-to-wiki-or-change-how-gui-setting-work/41337/ How to change GUI settings] Manjaro Forum
== Troubleshooting ==
 
If you have followed the above guide and still have issues, there are possibilities of other files conflicting. Xorg, GDM and Plasma may have overriden your settings. The respective Archlinux wiki for locale is an excellent place to look for a solution and of cource the Manjaro Forum is always the more welcoming community.
[https://forum.manjaro.org/t/one-distinct-language-per-user/37097/6 One distinct language per user] Manjaro Forum
 
== References ==
[https://wiki.archlinux.org/index.php/locale Locale] Arch Linux Wiki
Arch Linux Wiki - [https://wiki.archlinux.org/index.php/locale Locale], [https://wiki.archlinux.org/index.php/Xprofile Xprofile]


[https://wiki.archlinux.org/index.php/Xprofile xprofile] Arch Linux Wiki
Manjaro Forum Topics [https://forum.manjaro.org/t/request-add-correct-language-setting-to-wiki-or-change-how-gui-setting-work/41337/] [https://forum.manjaro.org/t/one-distinct-language-per-user/37097/6]
Anonymous user