The *system locale* specifies the language settings of system services and user interfaces. The *keyboard layout* settings control the layout used on the text console and graphical user interfaces.
These settings can be made by modifying the `/etc/locale.conf` configuration file or by using the [application]*localectl* utility. You can also set these settings during system installation using the installer graphical interface, text mode interface, or the [command]*keyboard* and [command]*lang* Kickstart commands. See the link:https://docs.fedoraproject.org/en-US/fedora/f{MAJOROSVER}/install-guide[{MAJOROS} Installation Guide] for information about these options.
System-wide locale settings are stored in the `/etc/locale.conf` file, which is read at early boot by the `systemd` daemon. The locale settings configured in `/etc/locale.conf` are inherited by every service or user, unless individual programs or individual users override them.
The basic file format of `/etc/locale.conf` is a newline-separated list of variable assignments. For example, German locale with English messages in `/etc/locale.conf` looks as follows:
Here, the LC_MESSAGES option determines the locale used for diagnostic messages written to the standard error output. To further specify locale settings in `/etc/locale.conf`, you can use several other options, the most relevant are summarized in xref:System_Locale_and_Keyboard_Configuration.adoc#tab-locale_options[Options configurable in /etc/locale.conf]. See the `locale(7)` manual page for detailed information on these options. Note that the LC_ALL option, which represents all possible options, should not be configured in `/etc/locale.conf`.
The [command]#localectl# command can be used to query and change the system locale and keyboard layout settings. To show the current settings, use the [option]`status` option:
[subs="quotes, macros"]
----
[command]#localectl# [option]`status`
----
.Displaying the Current Status
====
The output of the previous command lists the currently set locale, keyboard layout configured for the console and for the X11 window system.
To list all locales available for your system, type:
[subs="quotes, macros"]
----
[command]#localectl# [option]`list-locales`
----
.Listing Locales
====
Imagine you want to select a specific English locale, but you are not sure if it is available on the system. You can check that by listing all English locales with the following command:
Replace _locale_ with the locale name, found with the [command]#localectl# [option]`list-locales` command. The above syntax can also be used to configure parameters from xref:System_Locale_and_Keyboard_Configuration.adoc#tab-locale_options[Options configurable in /etc/locale.conf].
For example, if you want to set British English as your default locale, first find the name of this locale by using [option]`list-locales`. Then, as `root`, type the command in the following form:
To list all available keyboard layouts that can be configured on your system, type:
[subs="quotes, macros"]
----
[command]#localectl# [option]`list-keymaps`
----
.Searching for a Particular Keymap
====
You can use [command]#grep# to search the output of the previous command for a specific keymap name. There are often multiple keymaps compatible with your currently set locale. For example, to find available Czech keyboard layouts, type:
To set the default keyboard layout for your system, use the following command as `root`:
[subs="quotes, macros"]
----
[command]#localectl# [option]`set-keymap` _map_
----
Replace _map_ with the name of the keymap taken from the output of the [command]#localectl# [option]`list-keymaps` command. Unless the [option]`--no-convert` option is passed, the selected setting is also applied to the default keyboard mapping of the X11 window system, after converting it to the closest matching X11 keyboard mapping. This also applies in reverse, you can specify both keymaps with the following command as `root`:
With this option, the X11 keymap is specified without changing the previous console layout setting.
.Setting the X11 Keymap Separately
====
Imagine you want to use German keyboard layout in the graphical interface, but for console operations you want to retain the US keymap. To do so, type as `root`:
_variant_ and _options_ with keyboard variant and option components, which can be used to enhance the keyboard behavior. These options are not set by default. For more information on X11 Model, X11 Variant, and X11 Options see the `kbd(4)` man page.
For more information on how to configure the keyboard layout on Fedora, see the resources listed below:
.Installed Documentation
* `localectl`(1) — The manual page for the [command]#localectl# command line utility documents how to use this tool to configure the system locale and keyboard layout.
* `loadkeys`(1) — The manual page for the [command]#loadkeys# command provides more information on how to use this tool to change the keyboard layout in a virtual console.