Gentoo Archives: gentoo-user

From: Mike Edenfield <kutulu@××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] 200MB waste from /usr/share/locale ?
Date: Sat, 26 Nov 2011 06:33:53
Message-Id: 4ED0880E.5040706@kutulu.org
In Reply to: Re: [gentoo-user] 200MB waste from /usr/share/locale ? by Philip Webb
1 On 11/25/2011 10:00 PM, Philip Webb wrote:
2 > 111126 Florian Philipp wrote:
3 >> Am 26.11.2011 01:28, schrieb Sebastian Pipping:
4 >>> It seems that /usr/share/locale is keeping files for many languages
5 >>> not of any use to me: around 200MB in total.
6 >>> Is there a way to configure this away that I am not aware of?
7 >> Please follow the section "glibc Locales" in the Gentoo handbook.
8 >> http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?full=1#book_part1_chap6
9 >
10 > Yes, but that may not be the problem. I have just 2 locales requested,
11 > but /etc/share/locale/ contains 90 MB of material.
12 > A quick look suggests that most of it is in subdirs LC_MESSAGES ,
13 > wh seem to come from emerges at various dates;
14 > they are binary, so I don't know what they were reporting.
15 > Even under /usr/share/locale/en_US , which should show my 2 locales,
16 > there are only such messages. The locales do seem to work.
17 >
18 > Can anyone explain what is going on ?
19
20 Different packages include different levels of support for
21 filtering their installed localization messages, typically
22 one of "install everything", "install what's requested", or
23 "whats a locale?"
24
25 The reason you mostly have files under LC_MESSAGES is
26 because that's 99% of what is needed to localize a package.
27 The files in there are string resource packages,
28 translations of the strings used by the program, which are
29 picked up by the localization library (gettext)
30 automatically based on your locale settings. (coreutils
31 installs file into LC_TIME for locales with date/time
32 formatting requirements; I don't think I've ever seen any
33 other locale files.)
34
35 The standard way to inform a package which languages you
36 want is to set your LINGUAS variable in /etc/make.conf to
37 the locale name(s) you want installed (without the charset
38 specifier). LINGUAS works like any other portage expansion
39 variables: for those packages that support it, you get a set
40 of USE-flag-like language keywords set on build. (LINGUAS is
41 the well-known environment variable used by most
42 autotools-based packages to select languages, but portage
43 provides support above and beyond that.)
44
45 Unfortunately, proper locale support is spotty -- mostly due
46 to upstream maintainers being too lazy to properly add it to
47 their builds. Instead, the package will install every
48 message file it has available all the time.
49
50 You can safely delete any folders from /usr/share/locale for
51 locales that you don't have installed, since the normal
52 locale support in glibc will never ask for them. But they'll
53 just get put back next time you upgrade the package.
54
55 --Mike

Replies

Subject Author
Re: [gentoo-user] 200MB waste from /usr/share/locale ? Sebastian Pipping <sping@g.o>