- How to Change or Set System Locales in Linux
- How to View System Locale in Linux
- How to Set System Locale in Linux
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- Как русифицировать Linux Mint
- Как русифицировать Linux Mint 20?
- Шаг 1. Языковые настройки
- Шаг 2. Выбор русского языка интерфейса
- Шаг 3. Применение настроек
- Шаг 4. Выход из системы
- Шаг 5. Вход в систему с новыми настройками
- Выводы
- Как сменить locale в Debian или пишем кириллицей в консоли linux
- Linux Mint Forums
- Configuring locale and regional settings, the keyboard layout and working with file encodings
- Configuring locale and regional settings, the keyboard layout and working with file encodings
- Re: gm10’s Linux Mint Tools PPA
- Re: gm10’s Linux Mint Tools PPA
How to Change or Set System Locales in Linux
A locale is a set of environmental variables that defines the language, country, and character encoding settings (or any other special variant preferences) for your applications and shell session on a Linux system. These environmental variables are used by system libraries and locale-aware applications on the system.
Locale affects things such as the time/date format, the first day of the week, numbers, currency and many other values formatted in accordance with the language or region/country you set on a Linux system.
In this article, we will show how to view your currently installed system locale and how to set system’s locale in Linux.
How to View System Locale in Linux
To view information about the current installed locale, use the locale or localectl utility.
You can view more information about an environmental variable, for example LC_TIME, which stores the time and date format.
To display a list of all available locales use the following command.
How to Set System Locale in Linux
If you want to change or set system local, use the update-locale program. The LANG variable allows you to set the locale for the entire system.
The following command sets LANG to en_IN.UTF-8 and removes definitions for LANGUAGE.
To configure a specific locale parameter, edit the appropriate variable. For instance.
You can find global locale settings in the following files:
- /etc/default/locale – on Ubuntu/Debian
- /etc/locale.conf – on CentOS/RHEL
These files can also be edited manually using any of your favorite command line editors such as Vim or Nano, to configure your system locale.
To set a global locale for single user, you can simply open
/.bash_profile file and add the following lines.
For more information, see the locale, update-locale and localectl man pages.
That’s all! In this short article, we have explained how to view and set system local in Linux. If you have any questions, use the feedback form below to reach us.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник
Как русифицировать Linux Mint
На компьютере с уже установленной операционная системой семейства Linux язык интерфейса может по какой-то причине не устраивать пользователя. Кроме того, большинство Live-версий ОС по умолчанию используют английский язык для собственного интерфейса и интерфейса предустановленных программ.
В этой статье нами будет рассмотрен вопрос о том, как воспользоваться штатными средствами для изменения языка интерфейса операционной системы Linux Mint 20 Ulyana.
Как русифицировать Linux Mint 20?
Шаг 1. Языковые настройки
Языковые настройки интерфейса Linux Mint находятся в главном меню: Preferences -> Languages. Загрузите их:
Шаг 2. Выбор русского языка интерфейса
В открывшемся окне Language Settings в самой нижней строке Language Support нажмите на кнопку Install / Remove Languages (потребуется ввести пароль суперпользователя):
В открывшемся окне Install / Remove Languages видите, что в списке доступных языков по умолчанию нет русского. Для добавления его нажмите кнопку Add:
Откроется новый список языков. Найдите русский (Russian, Russia), выберите его и нажмите кнопку Install:
В процессе установки появится окно с предупреждением о том, что будет установлено дополнительное программное обеспечение. Нажмите кнопку Continue для продолжения установки:
Потребуется некоторое время для того, чтобы все языковые пакеты загрузились из репозитория и были установлены. В результате напротив выбранного языкового пакета (Russian, Russia) в списке языков появится статус установки русского — Fully Installed:
Закройте окно Install / Remove Languages.
Шаг 3. Применение настроек
В окне Language Settings для первых трёх параметров (Language, Region, Time Format) выберите русский язык и страну «Россия» (Russian, Russia) в качестве значений. Далее для того, чтобы новые значения группы параметров (System Locale) вступили в силу, нажмите кнопку Apply System-Wide:
Шаг 4. Выход из системы
Для того, чтобы загрузить новый русифицированный интерфейс Linux Mint 20, текущий пользователь должен заново выполнить авторизацию. Нажмите кнопку Logout в главном меню и затем заново авторизуйтесь:
Шаг 5. Вход в систему с новыми настройками
После того, как авторизуетесь, появится окно с предложением обновить имена стандартных папок в соответствии с новым языковыми установками. Нажмите кнопку Обновить имена (если есть такое желание на самом деле — часто этого не делают, по многим причинам):
Русифицирование интерфейса Linux Mint закончено. Вы можете в этом убедиться, открыв, к примеру, главное меню, файловый менеджер или браузер. Всё содержимое элементов интерфейса ОС и программ будет отображаться на русском языке (по крайней мере то, что официально русифицировано командой разработчиков Linux Mint):
Выводы
Теперь вы знаете как руссифицировать Linux Mint. Этот процесс довольно прост и интуитивно понятен. Однако заметим, что в том случае, если вы используете Live-версию ОС без установки на жёсткий диск, все изменения настроек, в том числе и языковых, действуют до первой перезагрузки. В этом случае придётся русифицировать вашу Linux Mint повторно.
Источник
Как сменить locale в Debian или пишем кириллицей в консоли linux
Я знаю что кириллица в логах Linux – это самый страшный грех для айтишника, но иногда это просто необходимость. Одна из таких необходимостей возникает при создании централизованного хранения log-файлов различных операционных систем. Microsoft всегда в своих log`ах применяет кириллицу и поэтому если мы хотим получать log-файлы и от Win-серверов, то стоит смириться, что в log`ах будет кирилица.
Для того, чтобы эти логи нормально отображались нам и нужно явно указать locale в Debian, Ubuntu или какой Linux-дистрибутив Вы используете.
Проблемы отображения кириллических символов в Linux не существует. Есть проблема у русской версии Windows. Весь мир и Linux в том числе, работает в кодировке UTF -8, когда русская версия Microsoft использует CP1251. Такая ситуация сложилось исторически благодаря компании «Парус», которая взяла на себя обязательства по локализации всех операционных систем Windows. Выбрали они почему-то кодировку CP1251, которая применяется до сих пор. Использование этой «неправильной» кодировки в наши дни обусловлено сохранением совместимости всех версий ОС.
Чтобы добавить кириллицу, чтобы Linux сервер нормально отображал русские буквы, нужно объяснить ему, что необходимо работать в той же кодировке, что и Windows.
Для того, чтобы управлять локалью в Linux, необходим пакет locales, который должен быть у Вас установлен. В большинстве случаев пакет locales уже будет у Вас установлен, поэтому для проформы просто проверяем этот факт.
Посмотреть установленную locale linux можно командой:
Для ручного указания кодировке в Linux Mint, Debian или ubuntu нужно отредактировать конфигурационный файл /etc/locale.gen :
Команду sudo не нужна, если Вы зашли как суперпользователь. Это относится к Linux Mint и Ubuntu, так как Debian ничего не знает о команде sudo.
В этом файле необходимо найти строчку и расскомментировать с той locale, которая Вам нужна. Для добавления кириллицы нужно раскомментировать строчки с UTF-8 или CP1251 .
- если хотим указать, чтобы ОС работала в UTF -8, раскомментирум:
- если хотим указать, чтобы ОС работала в CP1251, раскомментирум:
Стоит обратить внимание, что первые 2 символа (в нашем примере это ru) говорят нам о языке локализации (кириллица).
После этого переопределяем настройки locales командой:
Команда locale-gen позволяет запустить скрипт /etc/locale.gen и перечитывает все кодировки для консоли.
Чтобы увидеть кириллицу в консоли Linux, остается только перелогиниться.
Источник
Linux Mint Forums
Welcome to the Linux Mint forums!
Configuring locale and regional settings, the keyboard layout and working with file encodings
Configuring locale and regional settings, the keyboard layout and working with file encodings
Post by Drugwash » Mon Jul 01, 2019 3:47 am
I noticed you just pushed an update to mintlocale . I was curious what it was doing so I launched it in terminal. It threw a few deprecation warnings (remember my unusual system, may be related or not) and then opened the standard locale GUI. Well, I have a grief with the way this whole locale thing is treated (in Mint and other distros as well). Thought you may be listening, and maybe even do something about it. But first the warnings, FWIW:
Now, you see above that my system is a mix of English and Romanian. But it’s not that simple, and it could be more complicated if I were, for example, a brazilian person living in Bangladesh and having to work with a system set to an English interface. What I’m trying to say?
First, putting date/time together with interface language is a mistake — they may have nothing to do with each-other. The hypothetical person in my example may want date/time format set to Brazilian, for use in their documents. I want date/time format set to Romanian, or maybe a slight variation of it — manual override. In the GUI, not at the command line. At the same time, date and time should still reflect the current location.
Then, there is no (visible) way to set language for non-Unicode programs and documents (see Advanced option in Regional settings in WinXP/7). One may have to work with plaint text documents — no UTF-8 or Unicode BOM — written in a language different that the system language, at which point simple editors like Xed, gedit and others prove useless. Not even Geany could handle a few simple Romanian characters I tried to save as a text file, plus it automatically wanted to convert from UTF-8 to ISO-8859-16 without asking for the output format I wanted. I even uninstalled xed, it was lame. And no, converting or saving plain text files to UTF-8 or Unicode may not be the solution as they may require compatibility with non-Unicode operating systems and/or applications.
Of course, setting language for non-Unicode programs and documents may not be enough as the documents may use a completely different language; the simple editors should have a way to change font and character set manually. But that’s just another talk.
I’m not sure how WINE gets its regional/locale settings either from the host system but the same problems appear there too, where I can’t set the language for non-Unicode programs, which makes translated menus, dialogs, GUI controls in certain non-Unicode applications look ugly or unreadable.
Well, there you are one of my longstanding griefs with Linux. The other is with the Romanian (winkeys) layout variant which for who-knows-what reason moved the @ character from RAlt+V (as it always was from Win95 to Win10 — since Win7 this variant is called ‘legacy’) to RAlt+2 while introducing other RAlt+ combinations that have never been there in any Windows version. Why, oh why.
Long story short: is there anything that can be done to offer the user a proper GUI to tweak regional and language settings (keyboard layout included) exactly the way they need? Maybe by adding an ‘Advanced’ spoiler-like control that would open a larger GUI with individual settings?
Re: gm10’s Linux Mint Tools PPA
Post by gm10 » Mon Jul 01, 2019 5:04 am
mintlocale isn’t my code actually. My PPA pushes a few packages that get copied straight from the official Mint daily builds PPA, and the update you received yesterday is basically what will be the official LM 19.2 version of that package. There’s a few packages like that, it’s necessary to keep them compatible with the packages I have actually been modifying. So in this case feel free to actually report those warnings with the Linux Mint dev team, for they are theirs.
As to all the rest, it would probably best have been placed in one or several separate threads, but here goes:
Yes, I agree with you that mintlocale has a few limitations (also some others in addition to what you posted above). I’m not sure I want to rewrite the thing quite yet though.
For now, if you want more fine-grained control over your regional settings, edit the file
/.pam_environment . Note that due to one of the bugs in mintlocale there’s often some duplicated content in there, you can strip that all out. Then for setting your date/time locale to a different one than your UI, change the LC_TIME variable accordingly (and if it’s not in there, add it).
Re: gm10’s Linux Mint Tools PPA
Post by Drugwash » Mon Jul 01, 2019 6:04 am
Ah OK, I understand.
I won’t bother reporting those warnings as they may be specific to my system only.
/.pam_environment in my system. I vaguely remember changing LC_TIME in some file a few days ago but it didn’t stick.
If there’s character encoding option in xed then it’s too well hidden, or there was a problem on my side that prevented it to show up. This doesn’t nullify the fact that the system does need a global setting for non-Unicode documents/applications; they could all pick up that setting as default and if the user later on decides to change the encoding then it’s those applications developers’ task to provide the means to do it.
I do have at least some Windows fonts installed in both Wine and Mint so that’s not an issue. Having to run each Wine application with a prepended command is not at all handy. Not to mention creating a desktop shortcut for such applications is usually a PITA.
Thank you for that layout editor link but it’s just code, no installable package, and even the GitHub Clone or Download button wouldn’t work in my Pale Moon browser — no wonder, since M$ owns it now. It’ll be quite some time before I manage to learn how to compile code under Linux. It was much easier with Z80’s machine code back in the 90s.
Heh, I just wanted to reinstall xed to see about that character encoding, and Software Manager seems to be stuck in a loop — no cache updating, no repository search ever finishes — that circle keeps spinning and spinning. Then Synaptic put a lid on it:
Источник