Localization/Guide/ru

Часовой пояс
Для того чтобы сохранить время в соответствии с вашим месторасположением нужно настроить часовой пояс. Инструкции как сделать это для OpenRC и systemd можно найти в статье системное время.

Что такое локаль?
A locale is a set of information that most programs use for determining country and language specific settings. The locales and their data are part of the system library and can be found at on most systems. A locale name is generally named  where   is your two (or three) letter language code (as specified in ISO-639) and   is your two letter country code (as specified in ISO-3166). Variants are often appended to locale names, e.g.  or. Please explore Wikipedia to read more about locales and related articles.

Переменное окружение локали
Переменные, контролирующие различные аспекты настроек локали приведены в таблице ниже. Все они принимают одно из имен локали в формате   о котором рассказывалось ранее.

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

Генерация нужных локалей
Скорей всего вам требуется одна или две локали для вашей системы. Вы можете перечислить нужные вам локали в.

Далее запустите. Это сгенерирует все локали перечисленные в файле и запишет их в архив локалей.

Можно проверить какие локали доступны запустив.

Просмотреть файл можно с помощью команды.

OpenRC
Когда используется OpenRC настройки локали сохраняются в переменном окружении. Они, как правило, настраиваются в (для всей системы) и  (для конкретного пользователя) файлах. Больше информации можно найти в статье UTF-8. Системные настройки локали можно изменять с помощью. Например, так можно установить LANG в значение :

Конечно, вы можете отредактировать файл вручную и более точно настроить переменные для локали.

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:

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 the above snippet, users will be able to see localized file names properly, while not being forced to your preferred language.

После того, как вы настроили нужную локаль, не забудьте обновить переменное окружение, чтобы ваша система была в курсе изменений.

Для общистемной локали:

Для пользовательской локали:

После этого убейте процесс X-сервера нажав ++, выйдите из системы, а затем зайдите под учетною записью пользователя.

Теперь, убедитесь, что изменения вступили в силу:

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

Then set the desired locale:

Finally check if the result is good:

OpenRC
The keyboard layout used by the console is set in by the keymap 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.

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:

OpenRC
The keyboard layout to be used by the X server is specified in by the XkbLayout option. For details visit the Xorg guide.

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:

OpenRC
In order to get your console to display the Euro symbol, you will need to set the consolefont variable in to a file found in  (without the  ). has the Euro symbol.

You should verify that the service 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 fixed and variable definitions in to end in   instead of.

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 :

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

NLS
For message based localization to work in programs that support it and have the  (Native language support) USE flag, you will probably need to have the programs compiled with this flag set. Message strings are installed in files. 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 an additional localization variable called LINGUAS, which affects the localization files that get installed in gettext-based programs, and decides which GUI language packs should be downloaded and installed for some specific software packages, such as Firefox, Thunderbird, kde-base/kde-l10n or app-office/libreoffice-l10n. The variable takes in space-separated list of language codes, and a suggested place to set it is :

With, most ebuilds would install only the packages' default language but none of the   files. They would also not download and install any of the further language packs. For instance, the currently stable app-office/libreoffice receives further language support through which supports download and installation of the language packs defined in. Since the origin language of libreoffice is, it does not have   flag in. So with, libreoffice still supports.

To see the status of GUI translation, hyphenation, spell checking and other localisations on your language, please refer to the LibreOffice translation web site.

For finer grained control it can be set per package in :

A list of installed programs making use of the LINGUAS variable and their supported languages can be shown as follows:

A list of LINGUAS values that can be used is provided as :

After setting the  USE flag it may be necessary to re-emerge some packages:

Смотрите также

 * Настройка локалей (Gentoo Handbooks)
 * Keyboard layout в статье Evdev
 * X resources

Ссылки

 * Локализация и интернационализация (gnu.org)