Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-devhelp
Navigation:
Lists: gentoo-devhelp: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-devhelp@g.o
From: Nikos Chantziaras <realnc@...>
Subject: Re: LINGUAS vs LANGUAGES
Date: Fri, 15 May 2009 22:16:30 +0300
Daniel Pielmeier wrote:
> [...]
> You also might consider using a loop for installing the linguas else you
> have to add the same almost identical block for every new language
> introduced. This way the intermediate variable LANGS used for IUSE
> injection comes handy.
> 
> # IUSE definition:
> 
> IUSE="flags"
> 
> LANGS="de en"
> for i in ${LANGS}; do
> 	IUSE="${IUSE} linguas_${i}"
> done
> 
> # in src_install:
> 
> local my_langs
> 
> for j in ${LINGUAS}; do
> 	if has ${j} ${LANGS}; then
> 		my_langs="${j} ${my_langs}"
> 	fi
> done
> 
> insinto "${GAMES_DATADIR}/${PN}/i18n"
> for k in ${my_langs}; do
> 	doins "${PN}_${k}.qm" || die "doins ${PN}_${k}.qm failed"
> done

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

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



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


Updated Nov 16, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.