Bookmark this page

Internationalization

Language Support

Red Hat Enterprise Linux 7 officially supports 22 languages: English, Assamese, Bengali, Chinese (Simplified), Chinese (Traditional), French, German, Gujarati, Hindi, Italian, Japanese, Kannada, Korean, Malayalam, Marathi, Odia, Portuguese (Brazilian), Punjabi, Russian, Spanish, Tamil, and Telugu.

Per-user Language Selection

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

Language Settings

In the GNOME desktop environment, the user may 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. Run the command gnome-control-center region, or from the top bar, select (User)Settings. 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 the user logs in, these changes will take full effect.

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

Note

A user can make their shell environment use the same LANG setting as their graphical environment, even when they log in through a text console or over ssh. One way to do this is to place code similar to the following in the user's ~/.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/AccountService/users/${USER} \
  | sed 's/Language=//')
if [ "$i" != "" ]; then
    export LANG=$i
fi

Japanese, Korean, Chinese, and other languages with a non-Latin character set may not display properly on local text 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 24 17:55:01 CDT 2014

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 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 the user knows the character's Unicode code point, by typing 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 language, run the command localectl set-locale LANG=locale, where locale is the appropriate $LANG 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 and clicking the Login Screen button at the upper-right corner of the window. Changing the Language of the login screen will also adjust the system-wide default language setting stored in the /etc/locale.conf configuration file.

Important

Local text consoles such as tty2 are more limited in the fonts that they can display than gnome-terminal and ssh sessions. For example, Japanese, Korean, and Chinese characters may not display as expected on a local text console. For this reason, it may make sense to use English or another language with a Latin character set for the system's text console.

Likewise, local text 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 local text virtual consoles and the X11 graphical environment. See the localectl(1), kbd(4), and vconsole.conf(5) man pages for more information.

Language Packs

When using non-English languages, you may want to install additional "language packs" to provide additional translations, dictionaries, and so forth. To view the list of available language packs, run yum langavailable. To view the list of language packs currently installed on the system, run yum langlist. To add an additional language pack to the system, run yum langinstall code, where code is the code in square brackets after the language name in the output of yum langavailable.

References

locale(7), localectl(1), kbd(4), locale.conf(5), vconsole.conf(5), unicode(7), utf-8(7), and yum-langpacks(8) 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

Table 4. Language Codes

Language$LANG value
English (US)en_US.utf8
Assameseas_IN.utf8
Bengalibn_IN.utf8
Chinese (Simplified)zh_CN.utf8
Chinese (Traditional)zh_TW.utf8
Frenchfr_FR.utf8
Germande_DE.utf8
Gujaratigu_IN.utf8
Hindihi_IN.utf8
Italianit_IT.utf8
Japaneseja_JP.utf8
Kannadakn_IN.utf8
Koreanko_KR.utf8
Malayalamml_IN.utf8
Marathimr_IN.utf8
Odiaor_IN.utf8
Portuguese (Brazilian)pt_BR.utf8
Punjabipa_IN.utf8
Russianru_RU.utf8
Spanishes_ES.utf8
Tamilta_IN.utf8
Telugute_IN.utf8

Revision: rh415-7.5-b847083