1 |
On Thu, 19 Jul 2012 14:45:39 +0800 |
2 |
Ben de Groot <yngwin@g.o> wrote: |
3 |
|
4 |
> Today I would like to present to you my proposal for a new eclass with |
5 |
> helper functions for treating localizations: l10n.eclass (see the |
6 |
> attached file or [1]). Its functionality can be used in other eclasses |
7 |
> (such as qt4-r2 and cmake-utils) as well as directly in ebuilds. |
8 |
> |
9 |
> In order to keep the code simple, and prevent double loops and extra |
10 |
> variables (such as currently used in the media-video/smplayer ebuild), |
11 |
> I am proposing that we should add any missing long-form locales to |
12 |
> profiles/desc/linguas.desc (e.g. 'de_DE' in addition to short 'de'). |
13 |
> This also means that users may have to expand their LINGUAS setting in |
14 |
> make.conf (e.g. LINGUAS="de en" -> LINGUAS="de de_DE en en_US") to |
15 |
> cover the different variants used in packages. |
16 |
> |
17 |
> If you have any comments, spot any mistakes, or have proposals for |
18 |
> improvement, I would love to hear it! I would especially love from |
19 |
> maintainers of complicated packages such as libreoffice-l10n, if there |
20 |
> is any additional functionality that we could include in this eclass |
21 |
> to make their job simpler. |
22 |
> |
23 |
> 1: https://gitorious.org/gentoo-qt/qt/blobs/master/eclass/l10n.eclass |
24 |
|
25 |
I assume the P in PLOCALS stands for package. Not that obvious if you |
26 |
ask me. L10N_LOCALS would at least tell me which eclass this variable |
27 |
belongs to. |
28 |
|
29 |
Instead of using LINGUAS you should make use of the use function to get |
30 |
your cross sections. ie. |
31 |
|
32 |
for locale in ${PLOCALES}; do |
33 |
if use linguas_${locale}; then |
34 |
enabled_locales+=" ${locale}" |
35 |
else |
36 |
disabled_locales+=" ${locale}" |
37 |
fi |
38 |
done |
39 |
|
40 |
First, this is guaranteed by PMS and so independent of package manager |
41 |
and second, you do not have to care about locales in LINGUAS which are |
42 |
invalid for the package. Could be that Portage re-exports a sanitized |
43 |
LINGUAS tough, but I doubt it. |