From Gentoo Wiki
Jump to:navigation Jump to:search

This article explains how to obtain an Esperanto locale on Gentoo, by shamelessly stealing Debian's implementation.

For more general information on locales, see Localization. If you are following that as a guide, the procedure described here should be done before the "Generate locales" stage.

The process will create a number of temporary files, so do it in a temporary directory.

user $mkdir locale-eo && cd locale-eo

Download the latest version of Debian's Esperanto patch.

user $wget -O locale-eo_EO.diff ""

The patch contains both the new locale and a modification to the list of valid locales. We need to remove the unnecessary modification from the patch and extract the new locale file. Here we remove the unnecessary modification with filterdiff from dev-util/patchutils, but if you are familiar with the unified diff format you can do it manually with an editor.

root #emerge --ask dev-util/patchutils
user $filterdiff -p1 -i localedata/locales/eo locale-eo_EO.diff > locale-eo_EO-stripped.diff
user $patch -p3 < locale-eo_EO-stripped.diff

Now, manually install the locale file.

root #cp eo /usr/share/i18n/locales/

The Esperanto locale can now be generated like any other locale by adding it to /etc/locale.gen.

FILE /etc/locale.gen
eo_XX UTF-8

After running locale-gen, the Esperanto locale should be completely usable. For example:

user $LANG=eo_XX date
ĵaŭ Maj 30 23:33:31 CEST 2013

How you could have found the patch yourself

Say you start with the knowlege that Debian has locales in a package named "locales".

That is a virtual, which is provided by "locales-all".

This is still a distribution-only package, but clicking on the "Developer Information (PTS)" link takes us to the developer page for the source package, "eglibc".

Aha! A link to a dev-vcs/subversion repository. Click "Browse".

After some treasure-hunting, you'll find the patch you were looking for, 4 folders deep in the repository.