Skip to content

Linux Locale and Language

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Linux Locale and Language Guide

Complete beginner-friendly guide to configuring locales and languages on Linux, covering Arch Linux, CachyOS, and other distributions including language settings, input methods, and keyboard layouts.


Table of Contents

  1. Understanding Locales
  2. Setting Locale
  3. Language Configuration
  4. Input Methods
  5. Keyboard Layouts
  6. Troubleshooting

Understanding Locales

What is a Locale?

Locale defines language and regional settings.

What it includes:

  • Language: System language
  • Region: Regional formats
  • Character encoding: Text encoding
  • Date/time format: Date and time display
  • Number format: Number formatting
  • Currency: Currency format

Why configure:

  • Language: Use system in your language
  • Formats: Regional date/number formats
  • Comfort: Better user experience
  • Compatibility: Proper text encoding

Setting Locale

List Available Locales

List locales:

# List available locales
locale -a

Generate Locale

Edit locale.gen:

# Edit locale file
sudo vim /etc/locale.gen

Uncomment desired locale:

#en_US.UTF-8 UTF-8

Change to:

en_US.UTF-8 UTF-8

Generate locales:

# Generate locale
sudo locale-gen

Set Locale

Set system locale:

# Set locale
echo "LANG=en_US.UTF-8" | sudo tee /etc/locale.conf

# Set for user
echo "LANG=en_US.UTF-8" >> ~/.bashrc

Or use localectl:

# Set locale
sudo localectl set-locale LANG=en_US.UTF-8

Language Settings

Desktop Language

GNOME:

# Set language
gsettings set org.gnome.system.locale region 'en_US.UTF-8'

# Or use GUI
# Settings > Region & Language

KDE:

  1. System Settings → Regional Settings
  2. Select language

XFCE:

  1. Settings → Appearance → Fonts
  2. Configure language

⌨ Input Methods

Install Input Methods

Install IME:

# Arch/CachyOS
sudo pacman -S ibus ibus-gtk ibus-gtk3 ibus-qt

# For Chinese
sudo pacman -S ibus-libpinyin

# For Japanese
sudo pacman -S ibus-anthy ibus-mozc

Debian/Ubuntu:

sudo apt install ibus ibus-gtk ibus-gtk3

Fedora:

sudo dnf install ibus ibus-gtk ibus-gtk3

Configure Input Method

Start IBus:

# Start IBus
ibus-daemon -drx

# Configure
ibus-setup

⌨ Keyboard Layouts

Set Keyboard Layout

Using localectl:

# List layouts
localectl list-keymaps

# Set layout
sudo localectl set-keymap us

# Set X11 layout
sudo localectl set-x11-keymap us

Switch Keyboard Layout

GNOME:

  1. Settings → Keyboard
  2. Add layout
  3. Switch with: Super + Space

KDE:

  1. System Settings → Input Devices → Keyboard
  2. Add layout
  3. Switch with: Alt + Shift

XFCE:

  1. Settings → Keyboard → Layout
  2. Add layout

Troubleshooting

Locale Not Working

Check locale:

# Check current locale
locale

# Check locale.conf
cat /etc/locale.conf

Input Method Not Working

Restart IBus:

# Kill IBus
killall ibus-daemon

# Restart
ibus-daemon -drx

Summary

This guide covered locale and language configuration for Arch Linux, CachyOS, and other distributions, including locale setup, language settings, input methods, and keyboard layouts.


Next Steps


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally