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.
mkdir locale-eo && cd locale-eo
Download the latest version of Debian's Esperanto patch.
wget -O locale-eo_EO.diff "http://anonscm.debian.org/viewvc/pkg-glibc/glibc-package/trunk/debian/patches/localedata/locale-eo_EO.diff?view=co"
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.
emerge --ask dev-util/patchutils
filterdiff -p1 -i localedata/locales/eo locale-eo_EO.diff > locale-eo_EO-stripped.diff
patch -p3 < locale-eo_EO-stripped.diff
Now, manually install the locale file.
cp eo /usr/share/i18n/locales/
The Esperanto locale can now be generated like any other locale by adding it to /etc/locale.gen.
After running locale-gen, the Esperanto locale should be completely usable. For example:
ĵ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.