Localization/Guide/cs

Časové pásmo
Pro udržení správného údaje o čase je nutné nastavit časové pásmo, aby vás systém věděl, ve kterém z nich se nachází.

OpenRC
Své časové pásmo najdete v adresáři. Vyhněte se použití časových pásem v, neboť jejich názvy označují nečekaně jiné zóny. Například znamená ve skutečnosti GMT+8.

Předpokládejme, že chcete použít bruselské pásmo:

Nyní vepište svoje časové pásmo:

systemd
Pokud používáte systemd, nastavte časové pásmo pomocí příkazu. Nejprve se podívejte na dostupná pásma:

Po té nastavte vybrané pásmo:

Nakonec zkontrolujte výsledek spuštěním příkazu  bez parametrů:

Hardwarové hodiny
In most Gentoo Linux installations, your hardware clock is set to UTC (or GMT, Greenwich Mean Time) and then your timezone is taken into account to determine the actual, local time. If, for some reason, you need your hardware clock not to be in UTC, you will need to edit (or if you use Gentoo BSD: ) and change the value of   from   to.

Použití časového pásma UTC pro hodiny v /etc/conf.d/hwclock

Použití místního časového pásma hodin v /etc/conf.d/hwclock

Co je to locale?
Locale jsou soubory informací, které většina programů používá k určení toho, jaké nastavení zvolit s ohledem na daný stát a použitý jazyk. Jednotlivé locale a jim odpovídající sady dat jsou součástí systémové knihovny a na většině systémů je lze najít v. Název locale má většinou podobu, přičemž   označuje dvou (či tří) písmenný kód jazyka (dle ISO-639) a   označuje dvoupísmenný kód státu (vyjádřený v ISO-3166). K názvu mohou být dále připojeny jejich varianty, např. nebo. Více informací o locale si prosím vyhledejte na Wikipedii a v souvisejících článcích.

Proměnné prostředí vztahující se k locales
Proměnné řídící různé složky nastavení locale jsou vypsány v tabulce níže. Každá z nich může obsahovat název jednoho locale ve výše uvedeném formátu.

Most typically users only set the LANG variable on the global basis.

Generating Specific Locales
You will probably only use one or maybe two locales on your system. You can specify locales you will need in.

Adding locales to /etc/locale.gen

The next step is to run. It will generate all the locales you have specified in the file.

You can verify that your selected locales are available by running.

OpenRC
When using OpenRC locale settings are stored in environment variables. These are typically set in the (for system-wide settings) and  (for user-specific settings) file, and can be managed through. For instance, to set the  variable to the   value:

Of course, you can edit the file manually as well and diversify the locale variables.

Setting the default system locale in /etc/env.d/02locale

It's also possible, and pretty common especially in a more traditional UNIX environment, to leave the global settings unchanged, i.e. in the " " locale. Users can still specify their preferred locale in their own shell RC file:

Setting the user locale in ~/.bashrc

Another way of configuring system is to leave it in the default C locale, but enable UTF-8 character representation at the same time. This option is achieved using the following settings in :

Using traditional C locale while specifying UTF-8

Using the above snippet, users will be able to see localized file names properly, while not being forced to your preferred language.

Once you have set the right locale, be sure to update your environment variables to make your system aware of the change.

For a system-wide default locale:

For a user-specific locale:

After this, you will need to kill your X server by pressing, log out, then log in as user.

Now, verify that the changes have taken effect:

systemd
If you use systemd you should set your locale with the  command. Check the list of available locales with:

Then set the locale you want:

Finally check if the result is good:

OpenRC
The keyboard layout used by the console is set in by the   variable. Valid values can be found in. has further subdivisions into layout (,, etc.). Some languages have multiple options, so you may wish to experiment to decide which one fits your needs best.

Setting the console keymap

systemd
With systemd the keymap layout used for your console can be set using the  command. First check the available keymap layouts:

Then set the console keymap layout you want:

Finally check if the console keymap layout was set correctly:

Keyboard layout for the X server
The keyboard layout to be used by the X server is specified in by the   option.

Setting the X keymap

If you have an international keyboard layout, you should set the option  to   or  , as this will allow mapping of the additional keys specific to your keyboard.

Deadkeys allow you to press keys that will not show immediately but will be combined with another letter to produce a single character. Setting  to   allows input these special characters into X terminals.

If you would like to switch between more than one keyboard layout (for example English and Russian), all you have to do is add a few lines to that specify the desired layouts and the shortcut command.

Switching between two keyboard layouts

Here,  allows you to toggle between keyboard layouts by simply pressing. This will also toggle the Scroll Lock light on or off, thanks to the  option. This is a handy visual indicator of which keyboard layout you are using at the moment.

systemd
With systemd the keymap layout for the X11 server can be set using the  command. First check the available X11 keymap layouts:

Then set the X11 keymap layout you want:

Finally check if the X11 keymap layout was set correctly:

KDE
For KDE you have to install the  and   packages. These respect the described earlier.

The Euro Symbol for the Console
In order to get your console to display the Euro symbol, you will need to set  in  to a file found in  (without the   ). has the Euro symbol.

Setting the console font

You should verify that  is in the boot runlevel:

If no runlevel is displayed for , then add it to the proper level:

Most Applications
Getting the Euro symbol to work properly in X is a little bit tougher. The first thing you should do is change the  and   definitions in  to end in   instead of.

Setting default X fonts

Some applications use their own font, and you will have to tell them separately to use a font with the Euro symbol. You can do this at a user-specific level in (you can copy this file to  for use by new users), or at a global level for any application with a resource file in  (like xterm). In these files you generally have to change an existing line, rather than adding a new one. To change our xterm font, for instance:

The Euro symbol in (X)Emacs
To use the Euro symbol in (X)Emacs, add the following to :

setting the font for emacs

For XEmacs (not plain Emacs), you have to do a little more. In, add:

setting the font for xemacs

LibreOffice
The current stable  and   ebuilds support the  for selecting installed GUI language packs. To see the status of GUI translation, hyphenation, spell checking and other localisations on your language, please refer to LibreOffice translation web site.

NLS
For message based localization to work in programs that support it, you will probably need to have programs compiled with the  (Native language support) USE flag set. Most of the programs using nls also need the gettext library to extract and use localized messages. Of course, Portage will automatically install it when needed.

After enabling the  USE flag you may need to re-emerge some packages:

LINGUAS
There is also additional localization variable called, which affects to localization files that get installed in gettext-based programs, and decides used localization for some specific software packages, such as   and. The variable takes in space-separated list of language codes, and suggested place to set it is :

A list of locales that can be used is provided as :

After setting the  USE flag you may need to re-emerge some packages:

Resources
Xorg resources:
 * Keyboard layout inside the Evdev article

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide:


 * Alexander Holler
 * Steven Lucy
 * Benny Chuang
 * Lars Weiler
 * Tobias Scherbaum
 * Flammie Pirinen
 * nightmorph
 * klondike