Gentoo Archives: gentoo-devhelp

From: Daniel Pielmeier <daniel.pielmeier@××××××××××.com>
To: gentoo-devhelp@l.g.o
Subject: Re: [gentoo-devhelp] LINGUAS vs LANGUAGES
Date: Fri, 15 May 2009 16:35:49
Message-Id: 4A0D99DC.1090502@googlemail.com
In Reply to: Re: [gentoo-devhelp] LINGUAS vs LANGUAGES by Daniel Pielmeier
1 Daniel Pielmeier schrieb am 15.05.2009 17:01:
2 > 2009/5/15 Nikos Chantziaras <realnc@×××××.de>:
3 >>
4 >> # Install everything except documentation and i18n.
5 >> emake INSTALL_ROOT="${D}" install_target install_charmaps \
6 >> || die "make install failed"
7 >> # Install i18n files.
8 >> if use linguas_de; then
9 >> insinto "${GAMES_DATADIR}/${PN}/i18n"
10 >> doins "${PN}_de.qm" || die "doins ${PN}_de.qm failed"
11 >> fi
12
13 You also might consider using a loop for installing the linguas else you
14 have to add the same almost identical block for every new language
15 introduced. This way the intermediate variable LANGS used for IUSE
16 injection comes handy.
17
18 # IUSE definition:
19
20 IUSE="flags"
21
22 LANGS="de en"
23 for i in ${LANGS}; do
24 IUSE="${IUSE} linguas_${i}"
25 done
26
27 # in src_install:
28
29 local my_langs
30
31 for j in ${LINGUAS}; do
32 if has ${j} ${LANGS}; then
33 my_langs="${j} ${my_langs}"
34 fi
35 done
36
37 insinto "${GAMES_DATADIR}/${PN}/i18n"
38 for k in ${my_langs}; do
39 doins "${PN}_${k}.qm" || die "doins ${PN}_${k}.qm failed"
40 done
41
42 --
43 Daniel Pielmeier

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-devhelp] Re: LINGUAS vs LANGUAGES Nikos Chantziaras <realnc@×××××.de>