On 11/25/2011 10:00 PM, Philip Webb wrote:
111126 Florian Philipp wrote:
Am 26.11.2011 01:28, schrieb Sebastian Pipping:
It seems that /usr/share/locale is keeping files for many languages
not of any use to me: around 200MB in total.
Is there a way to configure this away that I am not aware of?
Please follow the section "glibc Locales" in the Gentoo handbook.
http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?full=1#book_part1_chap6

Yes, but that may not be the problem.  I have just  2  locales requested,
but  /etc/share/locale/  contains  90 MB  of material.
A quick look suggests that most of it is in subdirs LC_MESSAGES ,
wh seem to come from emerges at various dates;
they are binary, so I don't know what they were reporting.
Even under /usr/share/locale/en_US , which should show my  2  locales,
there are only such messages.  The locales do seem to work.

Can anyone explain what is going on ?

Different packages include different levels of support for filtering their installed localization messages, typically one of "install everything", "install what's requested", or "whats a locale?"

The reason you mostly have files under LC_MESSAGES is because that's 99% of what is needed to localize a package. The files in there are string resource packages, translations of the strings used by the program, which are picked up by the localization library (gettext) automatically based on your locale settings. (coreutils installs file into LC_TIME for locales with date/time formatting requirements; I don't think I've ever seen any other locale files.)

The standard way to inform a package which languages you want is to set your LINGUAS variable in /etc/make.conf to the locale name(s) you want installed (without the charset specifier). LINGUAS works like any other portage expansion variables: for those packages that support it, you get a set of USE-flag-like language keywords set on build. (LINGUAS is the well-known environment variable used by most autotools-based packages to select languages, but portage provides support above and beyond that.)

Unfortunately, proper locale support is spotty -- mostly due to upstream maintainers being too lazy to properly add it to their builds. Instead, the package will install every message file it has available all the time.

You can safely delete any folders from /usr/share/locale for locales that you don't have installed, since the normal locale support in glibc will never ask for them. But they'll just get put back next time you upgrade the package.

--Mike


Reply via email to