1 |
Nikos Chantziaras wrote: |
2 |
|
3 |
> Thanks. I ended up doing it this way, though with only one loop in |
4 |
> src_install(), which seems to be a bit more efficient and shorter: |
5 |
> |
6 |
> |
7 |
> LANGUAGES="de" |
8 |
> for i in ${LANGUAGES}; do |
9 |
> IUSE="${IUSE} linguas_${i}" |
10 |
> done |
11 |
> |
12 |
Just on a side-note (not saying it's how you want to do this one), this is |
13 |
something that BASH arrays are nice for (saving another loop): |
14 |
$ foo=(bar baz quux) |
15 |
$ echo "prefixed: '${foo[*]/#/pfx_}'" |
16 |
prefixed: 'pfx_bar pfx_baz pfx_quux' |
17 |
|
18 |
Parameter Expansion (incl on arrays) is discussed more at: |
19 |
http://mywiki.wooledge.org/BashFAQ/073 |
20 |
|
21 |
> src_install() |
22 |
> #... |
23 |
> insinto "${GAMES_DATADIR}/${PN}/i18n" |
24 |
> for i in ${LANGUAGES}; do |
25 |
> if has ${i} ${LINGUAS}; then |
26 |
> doins "${PN}_${i}.qm" || die #... |
27 |
> fi |
28 |
> done |
29 |
> |
30 |
> |
31 |
> In this case, LANGUAGES must not include "en" though, since there's no |
32 |
> ${PN}_en.qm file (English is built-in). I'm not sure if the following |
33 |
> would be better though, in case a user puts linguas_<language> in USE |
34 |
> instead of <language> in LINGUAS: |
35 |
> |
36 |
> if has linguas_${i} ${USE}; then |
37 |
> |
38 |
> But I suppose it would be the user's fault if he/she does that? :P |
39 |
|
40 |
Well yeah it's not the right way to set USE_EXPAND vars; LINGUAS is, and |
41 |
will be handled specially since it's one of that set. |
42 |
-- |
43 |
#friendly-coders -- We're friendly but we're not /that/ friendly ;-) |