- Localization (Русский)
- Contents
- Настройка
- Локаль
- Виртуальная консоль
- Шрифты
- Клавиатура
- Советы и рекомендации
- Русские man-страницы
- Перекодировка тегов MP3
- Linux: Define Locale and Language Settings
- Locale and Language Settings
- Add New Locale
- Ubuntu-18.04
- Ubuntu-14.04
- CentOS-7, CentOS-6
- Set Locale for the Current Session
- Define Locale and Language Permanently
- Set Default System Locale
- Ubuntu-18.04
- Ubuntu-14.04
- CentOS-7
- CentOS-6
- Change Language Settings in Ubuntu and Linux Mint
- Ubuntu
- Linux Mint
- How to Change the Language at the Command Line
Localization (Русский)
Под локализацией (localization, l10n) и интернационализацией (internationalization, i18n) понимается процесс адаптации программного обеспечения к культуре какой-либо страны (см. Википедия:Локализация программного обеспечения).
В статье описано, как настроить поддержку русского языка в Arch Linux.
Contents
Настройка
Локализация системы подразумевает главным образом три вещи: настройку локали и настройку клавиатуры в виртуальной консоли и графическом окружении (Xorg). Ниже приведены краткие рекомендации по каждому из пунктов без углубления в детали. Более подробную информацию можно найти в профильных статьях:
Локаль
Локаль — набор параметров, определяющий региональные настройки пользовательского интерфейса, такие как язык, страна, часовой пояс, набор символов, формат вывода даты, времени, используемая денежная единица. Чтобы настроить русскую локаль в вашей системе, следуйте инструкциям ниже.
Отредактируйте файл /etc/locale.gen , раскомментировав строку ru_RU.UTF-8 UTF-8 , после чего сгенерируйте локаль:
Проверьте, что заявленная локаль теперь доступна, выполнив locale -a . Когда локаль сгенерирована, установите её в качестве системной:
Перезагрузитесь, чтобы изменения вступили в силу. Команда locale без аргументов выводит список относящихся к настройкам локали переменных окружения. Если всё в порядке, то приложения должны «русифицироваться».
Виртуальная консоль
Настройки виртуальной консоли хранятся в файле /etc/vconsole.conf . Создайте файл и добавьте в него следующие строки:
В примере используется шрифт cyr-sun16 из пакета kbd (установлен по умолчанию, зависимость systemd). Если необходим шрифт покрупнее, то набор Terminus содержит шрифты разных размеров с поддержкой кириллических символов. Установите пакет terminus-font , после чего задайте необходимый шрифт переменной FONT в файле /etc/vconsole.conf . Шрифты Terminus именуются по схеме ter-* , список доступных шрифтов можно вывести командой:
Изменения вступят в силу после перезагрузки. Переключение языков привязано к комбинации клавиш Ctrl+Shift .
Шрифты
Установите пакеты ttf-dejavu и ttf-liberation со шрифтами DejaVu и Liberation соответственно.
Клавиатура
Прежде всего необходимо узнать модель клавиатуры. Откройте графический эмулятор терминала (не виртуальную консоль!) и выполните:
Команда вернёт список основных настроек клавиатуры. Нас интересует значение в строке model: . Например, стандартная клавиатура для ПК будет называться pc104 или pc105 . Для игровых клавиатур и клавиатур ноутбуков, которые часто имеют дополнительные клавиши, значение будет другим.
Задайте настройки клавиатуры с помощью утилиты localectl:
- us,ru — устанавливаются две языковые раскладки (layouts), английская (основная) и русская (дополнительная).
- pc105 — модель клавиатуры; если ваша модель отличается, то укажите её.
- «» — т.н. вариант раскладки. Поскольку указана пустая строка, то для обеих языковых раскладок будет использоваться вариант qwerty .
- grp:alt_shift_toggle — блок дополнительных опций; в примере задаётся всего одна опция, переключение языков по комбинации клавиш Alt+Shift .
Перезапустите Xorg или перезагрузитесь, чтобы изменения вступили в силу.
Советы и рекомендации
Русские man-страницы
man показывает страницы с учётом локали. Для принудительного показа русских страниц используйте следующую команду:
Перекодировка тегов MP3
Установите пакет python-mutagen и выполните следующую команду в каталоге с коллекцией MP3-файлов:
Команда перекодирует старые теги из кодировки CP1251 в UTF8, запишет тег версии id3v2.4 и удалит теги первой версии.
Источник
Linux: Define Locale and Language Settings
Locales are used in Linux to define which language and character set (encoding) user see in the terminal.
From this article you will learn how to check and change the current locale and language settings from the command line in Linux.
I will show how to check the current locale and language settings and how to get the list of available locals.
You will also see how to set locale and language temporary for the current session only as well as permanently for a single user or for the all users (change default system locale).
Cool Tip: Determine and change a file’s character encoding from the command line in Linux! The best solution for converting text files between different charsets! Read more →
Locale and Language Settings
Execute locale command to get the information about the current locale and language settings:
To list all enabled locales, run:
Locale is defined in the following format:
LANGUAGE | ISO 639 language code |
TERRITORY | ISO 3166 country code |
CODESET | Character set or encoding identifier, like ISO-8859-1 or UTF-8 |
e.g. Australian English with UTF-8 encoding is defined as: en_AU.UTF-8
Add New Locale
New locale: Before a locale can be enabled on the system, it must be generated.
If you didn’t find the desired language or encoding in the list of enabled locales, you can search for them in the list of all supported locales and install whatever you need.
Ubuntu-18.04
Supported releases: Ubuntu-15.04, 15.10, 16.04, 16.10, 18.04.
List the all supported (available for generation) locales:
Find the desired locale, for example:
Generate it with:
Now you should see it in the list of available locales:
Ubuntu-14.04
Supported releases: Ubuntu-9.10, 10.04, 10.10, 11.04, 11.10, 12.04, 12.10, 13.04, 13.10, 14.04, 14.10.
List the all supported (available for generation) locales:
Find the desired locale, for example:
Generate it with:
Now you should see it in the list of available locales:
CentOS-7, CentOS-6
List the all supported (available for generation) locales:
Find the desired locale, for example:
Generate it with:
Now you should see it in the list of available locales:
Set Locale for the Current Session
To set the required locale and language for the current session – it is just needed to redefine this variable.
Below you will find the examples of setting locales for some popular languages.
Set the environment variable LANG , as shown in the examples, to change a language and encoding for the current session:
Set the English locale:
Set the Russian locale:
Set the French locale:
Set the German locale:
Set the Hindi locale:
Define Locale and Language Permanently
For this you can set the required value of the LANG variable in a user’s bash profile and the needed locale and language settings will be automatically loaded upon the each session.
Put the following line to the
/.profile files, to change permanently the locale of the current user to en_US.utf8 :
By default, the modification will take effect after logout/login, but you can force it if you run one of the below commands, depending on in which file you have defined the LANG variable:
Set Default System Locale
Cool Tip: Create the awesome ASCII banners from the Linux command line and decorate your SSH warning messages! Read more →
Perform the following steps to permanently change the system locale (for the all users).
Ubuntu-18.04
Supported releases: Ubuntu-15.04, 15.10, 16.04, 16.10, 18.04.
Ubuntu-14.04
Supported releases: Ubuntu-9.10, 10.04, 10.10, 11.04, 11.10, 12.04, 12.10, 13.04, 13.10, 14.04, 14.10.
Edit the file with default locale settings:
Set the LANG variable:
CentOS-7
CentOS-6
Edit the file with default locale settings:
Set the LANG variable:
Reboot is required: Note that the above settings will take effect after reboot only.
Источник
Change Language Settings in Ubuntu and Linux Mint
Both Ubuntu and Linux Mint have support for many different languages. Wherever you come from or whatever language you speak, chances are that Ubuntu and Linux Mint supports your language.
Ubuntu
These steps work in the Unity and Ubuntu on Wayland desktop environments. You will need to type in your administrator password periodically to make these changes.
First, either type “language” in the search box, or click “Activities”, then type “language”. Select “Language Support” from the program list.
Ubuntu Language Support, Ubuntu Desktop Environment
» data-medium-file=»https://livingthelinuxlifestyle.files.wordpress.com/2020/01/ubuntu_language_support.png?w=300″ data-large-file=»https://livingthelinuxlifestyle.files.wordpress.com/2020/01/ubuntu_language_support.png?w=712″ src=»https://livingthelinuxlifestyle.files.wordpress.com/2020/01/ubuntu_language_support.png?w=712″ alt=»ubuntu_language_support» srcset=»https://livingthelinuxlifestyle.files.wordpress.com/2020/01/ubuntu_language_support.png?w=712 712w, https://livingthelinuxlifestyle.files.wordpress.com/2020/01/ubuntu_language_support.png?w=1424 1424w, https://livingthelinuxlifestyle.files.wordpress.com/2020/01/ubuntu_language_support.png?w=150 150w, https://livingthelinuxlifestyle.files.wordpress.com/2020/01/ubuntu_language_support.png?w=300 300w, https://livingthelinuxlifestyle.files.wordpress.com/2020/01/ubuntu_language_support.png?w=768 768w, https://livingthelinuxlifestyle.files.wordpress.com/2020/01/ubuntu_language_support.png?w=1024 1024w» sizes=»(max-width: 712px) 100vw, 712px»/> Ubuntu Language Support, Ubuntu Desktop Environment
If you get a warning message indicating that language support is not installed completely, click “Install”.
You may get a warning message saying that the system is waiting for the unattended upgrade to complete. If you get this message, simply reboot your computer and keep rebooting it until the unattended upgrade is finished.
Next, the Language Support dialog box will appear. Click “Install/Remove Languages”.
In the next window, you will see the languages that are already installed on your system. To install a new language in Ubuntu, simply check the box next to the language. Then click “Apply”.
In the Language tab of the Language Support dialog, click and drag the desired language to the top of the list. In my case, I have selected “Español: (México)” to drag to the top of the language list. The top level language will become the language for your menus and windows. Every language below the second one in the list will be ignored.
Click “Apply System-Wide”.
Now, click the “Regional Formats” tab. This will set the language for things like the date and time, currency and number formats. Again, select the desired language. In my example, I have selected “Español: (México)”. Click “Apply System-Wide.” Click “Close”.
Next, log out of Ubuntu and log back in to activate your language changes. Alternatively, you could also restart, or shut down and turn the computer back on again manually.
When Ubuntu starts again, a window will appear offering to activate the new language. The text will differ based on your chosen language. To accept the changes, click the button on the right. To cancel them, click the button on the left.
If the language settings were successful, the entire operating system should appear in the desired language.
Ubuntu 18.04 LTS with language set to Spanish, region set to Mexico.
» data-medium-file=»https://livingthelinuxlifestyle.files.wordpress.com/2020/02/ubuntu_language_spanish.png?w=300″ data-large-file=»https://livingthelinuxlifestyle.files.wordpress.com/2020/02/ubuntu_language_spanish.png?w=712″ src=»https://livingthelinuxlifestyle.files.wordpress.com/2020/02/ubuntu_language_spanish.png?w=712″ alt=»ubuntu_language_spanish» srcset=»https://livingthelinuxlifestyle.files.wordpress.com/2020/02/ubuntu_language_spanish.png?w=712 712w, https://livingthelinuxlifestyle.files.wordpress.com/2020/02/ubuntu_language_spanish.png?w=150 150w, https://livingthelinuxlifestyle.files.wordpress.com/2020/02/ubuntu_language_spanish.png?w=300 300w, https://livingthelinuxlifestyle.files.wordpress.com/2020/02/ubuntu_language_spanish.png?w=768 768w, https://livingthelinuxlifestyle.files.wordpress.com/2020/02/ubuntu_language_spanish.png 799w» sizes=»(max-width: 712px) 100vw, 712px»/> Ubuntu 18.04 LTS with language set to Spanish, region set to Mexico.
Linux Mint
Click the Menu button, then type “language” in the search bar.
Select “Languages: Language Settings”. By “Language Support”, click “Install/Remove Languages”.
Click the “Add…” button.
Scroll down until you find the desired language, then select it and click “Install”.
Then select the desired language and click “Install Language Packs”.
If the installation was successful, then the language list should read “Fully Installed” in green. Click “Close”.
Under Language Settings, click the button beside “Language”, then select the desired language. Repeat with the button beside “Region”. Click “Apply System-Wide” for both language and region.
Log out and log back in, or reboot your computer to apply the changes.
When you log back in, a dialog box will appear. To apply the changes, click the button on the right. To cancel, click the button on the left.
If the language settings were successful, the entire operating system interface will appear in the desired language.
Linux Mint 19.1 with language set to French, and region set to France.
» data-medium-file=»https://livingthelinuxlifestyle.files.wordpress.com/2020/02/linux_mint_language_french.png?w=300″ data-large-file=»https://livingthelinuxlifestyle.files.wordpress.com/2020/02/linux_mint_language_french.png?w=712″ src=»https://livingthelinuxlifestyle.files.wordpress.com/2020/02/linux_mint_language_french.png?w=712″ alt=»linux_mint_language_french» srcset=»https://livingthelinuxlifestyle.files.wordpress.com/2020/02/linux_mint_language_french.png?w=712 712w, https://livingthelinuxlifestyle.files.wordpress.com/2020/02/linux_mint_language_french.png?w=150 150w, https://livingthelinuxlifestyle.files.wordpress.com/2020/02/linux_mint_language_french.png?w=300 300w, https://livingthelinuxlifestyle.files.wordpress.com/2020/02/linux_mint_language_french.png?w=768 768w, https://livingthelinuxlifestyle.files.wordpress.com/2020/02/linux_mint_language_french.png 847w» sizes=»(max-width: 712px) 100vw, 712px»/> Linux Mint 19.1 with language set to French, and region set to France.
How to Change the Language at the Command Line
To change the language settings manually, simply edit two configuration files. You will need the codes for the desired language and country before editing these files. (You may need to download and install the language packs in Language Support prior to making these edits.) For example, to change the language to German:
sudo nano /etc/default/locale
Click CTRL+X to save your changes.
You may manually change the other settings in these files, as well. Log out and lock back in again, or restart the computer to complete the language settings change.
When you log back in, you will see a dialog box. To accept the changes, click the button on the right. To cancel, click the button on the left.
If you have any problems with the language settings, you can check them at the command line. Type the following command to see your language settings.
Ubuntu 18.04 LTS with language set to German, region set to Germany.
Источник