Linux Locale and Language - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
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
- Understanding Locales
- Setting Locale
- Language Configuration
- Input Methods
- Keyboard Layouts
- 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:
- System Settings → Regional Settings
- Select language
XFCE:
- Settings → Appearance → Fonts
- 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:
- Settings → Keyboard
- Add layout
- Switch with: Super + Space
KDE:
- System Settings → Input Devices → Keyboard
- Add layout
- Switch with: Alt + Shift
XFCE:
- Settings → Keyboard → Layout
- 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
- Time Synchronization - Time setup
- Desktop Environments - Desktop setup
- ArchWiki Locale: https://wiki.archlinux.org/title/Locale
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.