Setting language in linux

Change which language you use

You can use your desktop and applications in any of dozens of languages, provided you have the proper language packs installed on your computer.

  1. Open the Activities overview and start typing Region & Language .
  2. Click on Region & Language to open the panel.
  3. Click Language .
  4. Select your desired region and language. If your region and language are not listed, click at the bottom of the list to select from all available regions and languages.
  5. Click Select to save.
  6. Your session needs to be restarted for changes to take effect. Either click Restart… , or manually log back in later.

Some translations may be incomplete, and certain applications may not support your language at all. Any untranslated text will appear in the language in which the software was originally developed, usually American English.

There are some special folders in your home folder where applications can store things like music, pictures, and documents. These folders use standard names according to your language. When you log back in, you will be asked if you want to rename these folders to the standard names for your selected language. If you plan to use the new language all the time, you should update the folder names.

If there are multiple user accounts on your system, there is a separate instance of the Region & Language panel for the login screen. Click the Login Screen button at the top right to toggle between the two instances.

Источник

Как поменять язык Linux без переустановки системы

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

Если вы решили поменять язык Linux, то вам не нужно переустанавливать её — достаточно выполнить простые действия.

Чтобы узнать текущие языковые настройки, наберите команду:

Чтобы посмотреть доступные языковые настройки (локали), воспользуйтесь командой

Читайте также:  Red hat enterprise linux technical overview rh024

Для изменения языка системы, нужно, чтобы локаль, на которую вы хотите поменять язык, уже присутствовала в системе. Если её нет, то нужно добавить.

Чтобы добавить новую локаль, откройте файл /etc/locale.gen:

И раскомментируйте там строки с желаемыми новыми локалями. Затем выполните команду:

Теперь новые языковые настройки (новую локаль) вы можете видеть в списке доступных локалей.


Смена локали для текущий сессии

Чтобы поменять язык и кодировку для текущей сессии, вам нужно установить переменную окружения LANG, это можно сделать командой export:

# Установить английскую локаль export LANG=en_US.UTF-8 # Установить русскую локаль export LANG=ru_RU.UTF-8 # Установить французскую локаль export LANG=fr_FR.UTF-8

Если в вашей системе это не сработало, то замените переменную LANG на переменную LANGUAGE, например:

Изменение языковых настроек насовсем для одного пользователя

Добавьте строку с экспортом желаемой локали (например, export LANG=en_US.utf-8) в файл ~/.bashrc

Изменения начнут действовать после выхода/входа и будут действовать после каждой перезагрузки.

Изменение системной локали по умолчанию

Есть два альтернативных метода смены локали.

Первый — это запустить следующую команду (укажите нужную вам локаль):

sudo localectl set-locale LANG=en_US.UTF-8
sudo localectl set-locale LANG=ru_RU.UTF-8

Второй метод — прописать язык в файле /etc/locale.conf, откройте его:

и добавьте туда строку с нужной локалью:

После перезагрузки система предложит изменить имена папок на локализованные:

Чтобы это окно не появлялось при каждой загрузке системы, поставьте галочку «Не задавать больше этот вопрос».

Чтобы вновь открыть это окно, выполните в командной строке:

echo 'en_US' > ~/.config/user-dirs.locale xdg-user-dirs-gtk-update

Источник

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.

$ locale LANG=en_US.UTF-8 LANGUAGE=en_US LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= $ localectl status System Locale: LANG=en_US.UTF-8 LANGUAGE=en_US VC Keymap: n/a X11 Layout: us X11 Model: pc105

You can view more information about an environmental variable, for example LC_TIME, which stores the time and date format.

$ locale -k LC_TIME abday="Sun;Mon;Tue;Wed;Thu;Fri;Sat" day="Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday" abmon="Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec" mon="January;February;March;April;May;June;July;August;September;October;November;December" am_pm="AM;PM" d_t_fmt="%a %d %b %Y %r %Z" d_fmt="%m/%d/%Y" t_fmt="%r" t_fmt_ampm="%I:%M:%S %p" era= era_year="" era_d_fmt="" alt_digits= era_d_t_fmt="" era_t_fmt="" time-era-num-entries=0 time-era-entries="S" week-ndays=7 week-1stday=19971130 week-1stweek=1 first_weekday=1 first_workday=2 cal_direction=1 timezone="" date_fmt="%a %b %e %H:%M:%S %Z %Y" time-codeset="UTF-8" alt_mon="January;February;March;April;May;June;July;August;September;October;November;December" ab_alt_mon="Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec"

To display a list of all available locales use the following command.

$ locale -a C C.UTF-8 en_US.utf8 POSIX

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.

Читайте также:  Ubuntu remove linux kernel

The following command sets LANG to en_IN.UTF-8 and removes definitions for LANGUAGE.

$ sudo update-locale LANG=LANG=en_IN.UTF-8 LANGUAGE OR $ sudo localectl set-locale LANG=en_IN.UTF-8

To configure a specific locale parameter, edit the appropriate variable. For instance.

$ sudo update-locale LC_TIME=en_IN.UTF-8 OR $ sudo localectl set-locale LC_TIME=en_IN.UTF-8

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.

LANG="en_IN.utf8" export LANG

For more information, see the locale, update-locale and localectl man pages.

$ man locale $ man update-locale $ man localectl

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.

Источник

How to Change System Language (Locale) in Ubuntu and Debian?

Locale settings determine the operating system language and regional settings used in the terminal and in the graphical interface (date and time format, currency symbols, available character sets, etc.). This article will look at how to check or set locale settings on Linux distros (Ubuntu, Debian, Mint, etc.).

You can list the current locale settings in Ubuntu and Debian using the command:

get locale in ubuntu linux

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=»en_US.UTF-8″
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=»en_US.UTF-8″
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=»en_US.UTF-8″
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=

List of available locales on the host:

list available system locales

To display detailed information about the locales installed on the current Linux host:

Читайте также:  Linux сортировка вывода команды

The C.UTF-8 system locale is always present in this list. Let’s try to add the German locale de_DE.UTF-8.

The list of locales available for installation is listed in the file:

To install the locale you need, run the command:

locale-gen - generate new locale fles

You can also enable locales you need by uncommenting the lines in the file /etc/locale.gen:

/etc/locale.gen

To set the default locale, use the command:

$ sudo update-locale LANG=de_DE.UTF-8
$ sudo localectl set-locale LANG=de_DE.UTF-8

This command will write the following line to the /etc/default/locale:

Reboot the Linux host to apply the new locale settings.

You can set a separate locale for different parts of Linux, for example:

$ sudo update-locale LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LC_MONETARY=en_US.UTF-8

If you specify a locale that has not yet been generated, the locale command will return errors:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=fr_FR.utf8

In some cases, you must first set the required locale:

$sudo apt-get install language-pack-fr

If the locale is not set on Linux and the locale -a command returns only three entries:

    You need to generate new locale settings:

sudo update-locale LANG=de_DE.UTF-8

For easier locale management on Debian and Ubuntu, you can use the dpkg-reconfigure tool.

With the following command you can generate, set, or remove locales on Linux:

$ sudo dpkg-reconfigure locales

The utility provides a simple pseudo-graphical interface. Select the locales to install.

dpkg-reconfigure locales

Then set the default locale (default locale for the system environment).

dpkg-reconfigure set default locale for the system environment

To change the encoding in the console (terminal), run the command:

$ sudo dpkg-reconfigure console-setup

Select UTF-8 encoding for the console, then choose which character set support to add.

dpkg-reconfigure console-setup

These settings are stored in:

$ cat /etc/default/console-setup

Then configure the keyboard:

$ sudo dpkg-reconfigure keyboard-configuration

The default recommended keyboard model is Generic 105-key PC. Then add the keyboard mappings (keymaps) for the desired country.

Keyboard settings are specified in the file:

It remains to set the time zone:

$ sudo dpkg-reconfigure tzdata

You can remove locales you don’t use. The list of installed locales is in /usr/lib/locale/locale-archive.

List the locales in the archive:

delete locales in linux with localedef

$ sudo localedef --delete-from-archive en_IN.utf8

Источник

Оцените статью
Adblock
detector