Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-devhelp
Navigation:
Lists: gentoo-devhelp: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-devhelp@g.o
From: Steven J Long <slong@...>
Subject: Re: LINGUAS vs LANGUAGES
Date: Tue, 21 Jul 2009 11:13:25 +0100
Nikos Chantziaras wrote:

> Thanks.  I ended up doing it this way, though with only one loop in
> src_install(), which seems to be a bit more efficient and shorter:
> 
> 
> LANGUAGES="de"
> for i in ${LANGUAGES}; do
> IUSE="${IUSE} linguas_${i}"
> done
>
Just on a side-note (not saying it's how you want to do this one), this is
something that BASH arrays are nice for (saving another loop):
$ foo=(bar baz quux)
$ echo "prefixed: '${foo[*]/#/pfx_}'"
prefixed: 'pfx_bar pfx_baz pfx_quux'

Parameter Expansion (incl on arrays) is discussed more at:
http://mywiki.wooledge.org/BashFAQ/073

> src_install()
> #...
> insinto "${GAMES_DATADIR}/${PN}/i18n"
> for i in ${LANGUAGES}; do
> if has ${i} ${LINGUAS}; then
> doins "${PN}_${i}.qm" || die #...
> fi
> done
> 
> 
> In this case, LANGUAGES must not include "en" though, since there's no
> ${PN}_en.qm file (English is built-in).  I'm not sure if the following
> would be better though, in case a user puts linguas_<language> in USE
> instead of <language> in LINGUAS:
> 
>    if has linguas_${i} ${USE}; then
> 
> But I suppose it would be the user's fault if he/she does that? :P

Well yeah it's not the right way to set USE_EXPAND vars; LINGUAS is, and
will be handled specially since it's one of that set.
-- 
#friendly-coders -- We're friendly but we're not /that/ friendly ;-)




Replies:
Re: LINGUAS vs LANGUAGES
-- Nikos Chantziaras
Re: Re: LINGUAS vs LANGUAGES
-- Mike Frysinger
References:
Re: LINGUAS vs LANGUAGES
-- Nikos Chantziaras
Re: LINGUAS vs LANGUAGES
-- Daniel Pielmeier
Re: LINGUAS vs LANGUAGES
-- Daniel Pielmeier
Re: LINGUAS vs LANGUAGES
-- Nikos Chantziaras
Navigation:
Lists: gentoo-devhelp: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: LINGUAS vs LANGUAGES
Next by thread:
Re: Re: LINGUAS vs LANGUAGES
Previous by date:
Re: LINGUAS vs LANGUAGES
Next by date:
Re: Re: LINGUAS vs LANGUAGES


Updated Jun 03, 2012

Summary: Archive of the gentoo-devhelp mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.