Add a custom locale to your Fedora system

The goal
After discovering KDE Plasma offered the option to use the non-standard locale en_NL, I tried to install this locale system wide on my Fedora 35 system. I never found out how Plasma does it, but compiling a new custom locale seems to work.

Prerequisites
1.) Fedora does not ship character maps by default. Without these localedef will report an error about a missing character map file and do nothing. To get these, run:

sudo dnf install glibc-locale-source

Character maps are now available in /usr/share/i18n/charmaps/

2.) Get a locale definition file. I got mine (en_NL) from https://github.com/PanderMusubi/locale-en-nl. Copy it into /usr/share/i18n/locales/:

sudo cp en_NL /usr/share/i18n/locales

Compile
To compile the new locale, run:

sudo localedef -f UTF8 -i en_NL en_NL.UTF-8

Make use of it
The new locale is not yet set as the system’s locale. To make it so, run:

sudo localectl set-locale LANG=en_NL.UTF-8

Reboot
And done…

2 Likes