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 1S0y9t-00048m-Gd for garchives@archives.gentoo.org; Fri, 24 Feb 2012 16:38:13 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C7798E0F8D; Fri, 24 Feb 2012 16:37:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2905FE0F6D for ; Fri, 24 Feb 2012 16:37:00 +0000 (UTC) Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com [209.85.210.53]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id B32271B403A for ; Fri, 24 Feb 2012 16:36:59 +0000 (UTC) Received: by dady25 with SMTP id y25so3195519dad.40 for ; Fri, 24 Feb 2012 08:36:58 -0800 (PST) Received-SPF: pass (google.com: domain of floppym@gentoo.org designates 10.68.203.71 as permitted sender) client-ip=10.68.203.71; Authentication-Results: mr.google.com; spf=pass (google.com: domain of floppym@gentoo.org designates 10.68.203.71 as permitted sender) smtp.mail=floppym@gentoo.org Received: from mr.google.com ([10.68.203.71]) by 10.68.203.71 with SMTP id ko7mr9736529pbc.76.1330101418270 (num_hops = 1); Fri, 24 Feb 2012 08:36:58 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Received: by 10.68.203.71 with SMTP id ko7mr8079337pbc.76.1330101418258; Fri, 24 Feb 2012 08:36:58 -0800 (PST) Received: by 10.68.46.135 with HTTP; Fri, 24 Feb 2012 08:36:58 -0800 (PST) In-Reply-To: <1328720665.16022.8.camel@daedalus.lan> References: <1328720665.16022.8.camel@daedalus.lan> Date: Fri, 24 Feb 2012 11:36:58 -0500 Message-ID: Subject: Re: [gentoo-dev] Understanding the LINGUAS variable and use-expand From: Mike Gilbert To: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: a33bc9da-ac55-4673-bceb-930716b5f9bf X-Archives-Hash: 21f8330d527695f6e95e13f07b4dbac8 On Wed, Feb 8, 2012 at 12:04 PM, Mart Raudsepp wrote: > On K, 2012-02-08 at 11:32 -0500, Mike Gilbert wrote: >> I am considering simplifying www-client/chromium from the current mess >> based on the linguas USE flags to basically just this: >> >> if [[ ${LINGUAS} ]]; then >> =C2=A0 for x in *.pak; do >> =C2=A0 =C2=A0 mylang=3D${x%.pak} >> =C2=A0 =C2=A0 mylang=3D%{x/-/_} >> =C2=A0 =C2=A0 has $mylang $LINGUAS || rm $x >> =C2=A0 done >> fi > I think users could be surprised a bit about cases where you have > variants or dialects, e.g currently as IUSE=3Dlinguas_fr_FR, when users > only have LINGUAS=3Dfr - in gettext they often don't have a fr_FR.po, jus= t > fr.po; if locale has LC_MESSAGE and LANG at fr_FR, it will look at "fr" > if more specific fr_FR not found. > I define things like LINGUAS=3D"en en_US et et_EE" to be really sure, but > I doubt many users do that (but that's just a guess). > If it's exposed via IUSE, then they can at least have some visual cue of > that. > I guess it wouldn't be a concern if we had a tool to set the LINGUAS > that handled this variant logic nicely, or just educating users in > documentation, make.conf.example comments and so on. Thanks for catching that Mart. I think I have addressed the dialect issue by more directly emulating the autoconf macro. See below. I would greatly appreciate any additional feedback anyone has on this subje= ct. New code, currently used (experimentally) in google-chrome-19.0.1049.3_alpha123257.ebuild: if [[ "%UNSET%" !=3D "${LINGUAS-%UNSET}" ]]; then local found desiredlang presentlang pak pakname pushd "${CHROME_HOME}locales" > /dev/null || die for pak in *.pak; do pakname=3D"${pak%.pak}" pakname=3D"${pakname/-/_}" presentlang=3D"$(chromium_lang "${pakname}")" # Do not issue warning for en_US locale. This is the fallback # locale so it should always be installed. if [[ "${presentlang}" =3D=3D "en_US" ]]; then continue fi found=3D for desiredlang in ${LINGUAS}; do if [[ "${desiredlang}" =3D=3D "${presentlang}"* ]]; then found=3D1 break fi done if [[ -z ${found} ]]; then rm "${pak}" || die fi done popd > /dev/null fi