From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1M52ti-00034M-4m for garchives@archives.gentoo.org; Fri, 15 May 2009 19:16:46 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 92DACE0392; Fri, 15 May 2009 19:16:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6F44BE0392 for ; Fri, 15 May 2009 19:16:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 18E1865E58 for ; Fri, 15 May 2009 19:16:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -3.458 X-Spam-Level: X-Spam-Status: No, score=-3.458 required=5.5 tests=[AWL=0.141, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TJnLjyWCVT0J for ; Fri, 15 May 2009 19:16:39 +0000 (UTC) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id EDA7765FF0 for ; Fri, 15 May 2009 19:16:37 +0000 (UTC) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1M52tV-0007fM-PX for gentoo-devhelp@gentoo.org; Fri, 15 May 2009 19:16:33 +0000 Received: from athedsl-380040.home.otenet.gr ([79.131.36.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 May 2009 19:16:33 +0000 Received: from realnc by athedsl-380040.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 May 2009 19:16:33 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-devhelp@lists.gentoo.org From: Nikos Chantziaras Subject: [gentoo-devhelp] Re: LINGUAS vs LANGUAGES Date: Fri, 15 May 2009 22:16:30 +0300 Organization: Lucas Barks Message-ID: References: <6142e6140905150705n3db6e281g43439abe11eb1fb7@mail.gmail.com> <4A0D8068.3090304@arcor.de> <6142e6140905150801y7d9a6698obe04cb1c1dd01ca@mail.gmail.com> <4A0D99DC.1090502@googlemail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Development-related help X-BeenThere: gentoo-devhelp@gentoo.org X-BeenThere: gentoo-devhelp@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: athedsl-380040.home.otenet.gr User-Agent: Thunderbird 2.0.0.21 (X11/20090429) In-Reply-To: <4A0D99DC.1090502@googlemail.com> Sender: news X-Archives-Salt: 7a6c3107-0a8d-40b1-ab8d-e844eeae1aa7 X-Archives-Hash: c6896d773bff508c01763e411fe26d1f 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_ in USE instead of in LINGUAS: if has linguas_${i} ${USE}; then But I suppose it would be the user's fault if he/she does that? :P