Bookmark this page

Internationalization

Per-user Language Selection

Your users might prefer to use a different language for their desktop environment than the system-wide default. They might also want to use a different keyboard layout or input method for their account.

Language Settings

In the GNOME desktop environment, the user might be prompted to set their preferred language and input method on first login. If not, then the easiest way for an individual user to adjust their preferred language and input method settings is to use the Region & Language application.

You can start this application in two ways. You can run the command gnome-control-center region from a terminal window, or on the top bar, from the system menu in the right corner, select the settings button (which has a crossed screwdriver and wrench for an icon) from the bottom left of the menu.

In the window that opens, select Region & Language. Click the Language box and select the preferred language from the list that appears. This also updates the Formats setting to the default for that language. The next time you log in, these changes will take full effect.

These settings affect the GNOME desktop environment and any applications such as gnome-terminal that are started inside it. However, by default they do not apply to that account if accessed through an ssh login from a remote system or a text-based login on a virtual console (such as tty5).

Note

You can make your shell environment use the same LANG setting as your graphical environment, even when you log in through a text-based virtual console or over ssh. One way to do this is to place code similar to the following in your ~/.bashrc file. This example code will set the language used on a text login to match the one currently set for the user's GNOME desktop environment:

i=$(grep 'Language=' /var/lib/AccountsService/users/${USER} \
  | sed 's/Language=//')
if [ "$i" != "" ]; then
    export LANG=$i
fi

Japanese, Korean, Chinese, and other languages with a non-Latin character set might not display properly on text-based virtual consoles.

Individual commands can be made to use another language by setting the LANG variable on the command line:

[user@host ~]$ LANG=fr_FR.utf8 date
jeu. avril 25 17:55:01 CET 2019

Subsequent commands will revert to using the system's default language for output. The locale command can be used to determine the current value of LANG and other related environment variables.

Input Method Settings

GNOME 3 in Red Hat Enterprise Linux 7 or later automatically uses the IBus input method selection system, which makes it easy to change keyboard layouts and input methods quickly.

The Region & Language application can also be used to enable alternative input methods. In the Region & Language application window, the Input Sources box shows what input methods are currently available. By default, English (US) may be the only available method. Highlight English (US) and click the keyboard icon to see the current keyboard layout.

To add another input method, click the + button at the bottom left of the Input Sources window. An Add an Input Source window will open. Select your language, and then your preferred input method or keyboard layout.

When more than one input method is configured, the user can switch between them quickly by typing Super+Space (sometimes called Windows+Space). A status indicator will also appear in the GNOME top bar, which has two functions: It indicates which input method is active, and acts as a menu that can be used to switch between input methods or select advanced features of more complex input methods.

Some of the methods are marked with gears, which indicate that those methods have advanced configuration options and capabilities. For example, the Japanese Japanese (Kana Kanji) input method allows the user to pre-edit text in Latin and use Down Arrow and Up Arrow keys to select the correct characters to use.

US English speakers may also find this useful. For example, under English (United States) is the keyboard layout English (international AltGr dead keys), which treats AltGr (or the right Alt) on a PC 104/105-key keyboard as a "secondary shift" modifier key and dead key activation key for typing additional characters. There are also Dvorak and other alternative layouts available.

Note

Any Unicode character can be entered in the GNOME desktop environment if you know the character's Unicode code point. Type Ctrl+Shift+U, followed by the code point. After Ctrl+Shift+U has been typed, an underlined u will be displayed to indicate that the system is waiting for Unicode code point entry.

For example, the lowercase Greek letter lambda has the code point U+03BB, and can be entered by typing Ctrl+Shift+U, then 03BB, then Enter.

System-wide Default Language Settings

The system's default language is set to US English, using the UTF-8 encoding of Unicode as its character set (en_US.utf8), but this can be changed during or after installation.

From the command line, the root user can change the system-wide locale settings with the localectl command. If localectl is run with no arguments, it displays the current system-wide locale settings.

To set the system-wide default language, run the command localectl set-locale LANG=locale, where locale is the appropriate value for the LANG environment variable from the "Language Codes Reference" table in this chapter. The change will take effect for users on their next login, and is stored in /etc/locale.conf.

[root@host ~]# localectl set-locale LANG=fr_FR.utf8

In GNOME, an administrative user can change this setting from Region & Language by clicking the Login Screen button at the upper-right corner of the window. Changing the Language of the graphical login screen will also adjust the system-wide default language setting stored in the /etc/locale.conf configuration file.

Important

Text-based virtual consoles such as tty4 are more limited in the fonts they can display than terminals in a virtual console running a graphical environment, or pseudoterminals for ssh sessions. For example, Japanese, Korean, and Chinese characters may not display as expected on a text-based virtual console. For this reason, you should consider using English or another language with a Latin character set for the system-wide default.

Likewise, text-based virtual consoles are more limited in the input methods they support, and this is managed separately from the graphical desktop environment. The available global input settings can be configured through localectl for both text-based virtual consoles and the graphical environment. See the localectl(1) and vconsole.conf(5) man pages for more information.

Language Packs

Special RPM packages called langpacks install language packages that add support for specific languages. These langpacks use dependencies to automatically install additional RPM packages containing localizations, dictionaries, and translations for other software packages on your system.

To list the langpacks that are installed and that may be installed, use yum list langpacks-*:

[root@host ~]# yum list langpacks-*
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Installed Packages
langpacks-en.noarch      1.0-12.el8        @AppStream
Available Packages
langpacks-af.noarch      1.0-12.el8        rhel-8-for-x86_64-appstream-rpms
langpacks-am.noarch      1.0-12.el8        rhel-8-for-x86_64-appstream-rpms
langpacks-ar.noarch      1.0-12.el8        rhel-8-for-x86_64-appstream-rpms
langpacks-as.noarch      1.0-12.el8        rhel-8-for-x86_64-appstream-rpms
langpacks-ast.noarch     1.0-12.el8        rhel-8-for-x86_64-appstream-rpms
...output omitted...

To add language support, install the appropriate langpacks package. For example, the following command adds support for French:

[root@host ~]# yum install langpacks-fr

Use yum repoquery --whatsupplements to determine what RPM packages may be installed by a langpack:

[root@host ~]# yum repoquery --whatsupplements langpacks-fr
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Last metadata expiration check: 0:01:33 ago on Wed 06 Feb 2019 10:47:24 AM CST.
glibc-langpack-fr-0:2.28-18.el8.x86_64
gnome-getting-started-docs-fr-0:3.28.2-1.el8.noarch
hunspell-fr-0:6.2-1.el8.noarch
hyphen-fr-0:3.0-1.el8.noarch
libreoffice-langpack-fr-1:6.0.6.1-9.el8.x86_64
man-pages-fr-0:3.70-16.el8.noarch
mythes-fr-0:2.3-10.el8.noarch

Important

Langpacks packages use RPM weak dependencies in order to install supplementary packages only when the core package that needs it is also installed.

For example, when installing langpacks-fr as shown in the preceding examples, the mythes-fr package will only be installed if the mythes thesaurus is also installed on the system.

If mythes is subsequently installed on that system, the mythes-fr package will also automatically be installed due to the weak dependency from the already installed langpacks-fr package.

References

locale(7), localectl(1), locale.conf(5), vconsole.conf(5), unicode(7), and utf-8(7) man pages

Conversions between the names of the graphical desktop environment's X11 layouts and their names in localectl can be found in the file /usr/share/X11/xkb/rules/base.lst.

Language Codes Reference

Note

This table might not reflect all langpacks available on your system. Use yum info langpacks-SUFFIX to get more information about any particular langpacks package.

Table 4. Language Codes

LanguageLangpacks Suffix$LANG value
English (US)enen_US.utf8
Assameseasas_IN.utf8
Bengalibnbn_IN.utf8
Chinese (Simplified)zh_CNzh_CN.utf8
Chinese (Traditional)zh_TWzh_TW.utf8
Frenchfrfr_FR.utf8
Germandede_DE.utf8
Gujaratigugu_IN.utf8
Hindihihi_IN.utf8
Italianitit_IT.utf8
Japanesejaja_JP.utf8
Kannadaknkn_IN.utf8
Koreankoko_KR.utf8
Malayalammlml_IN.utf8
Marathimrmr_IN.utf8
Odiaoror_IN.utf8
Portuguese (Brazilian)pt_BRpt_BR.utf8
Punjabipapa_IN.utf8
Russianruru_RU.utf8
Spanisheses_ES.utf8
Tamiltata_IN.utf8
Telugutete_IN.utf8

Revision: rh134-8.2-f0a9756