public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Understanding the LINGUAS variable and use-expand
Date: Fri, 24 Feb 2012 11:36:58 -0500	[thread overview]
Message-ID: <CAJ0EP40pan8dD1gqot59Ji32Ec6GMKVP71J=-gSBAD0rdjV-4w@mail.gmail.com> (raw)
In-Reply-To: <1328720665.16022.8.camel@daedalus.lan>

On Wed, Feb 8, 2012 at 12:04 PM, Mart Raudsepp <leio@gentoo.org> 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
>>   for x in *.pak; do
>>     mylang=${x%.pak}
>>     mylang=%{x/-/_}
>>     has $mylang $LINGUAS || rm $x
>>   done
>> fi

> I think users could be surprised a bit about cases where you have
> variants or dialects, e.g currently as IUSE=linguas_fr_FR, when users
> only have LINGUAS=fr - in gettext they often don't have a fr_FR.po, just
> 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="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 subject.


New code, currently used (experimentally) in
google-chrome-19.0.1049.3_alpha123257.ebuild:

 if [[ "%UNSET%" != "${LINGUAS-%UNSET}" ]]; then
   local found desiredlang presentlang pak pakname

   pushd "${CHROME_HOME}locales" > /dev/null || die

   for pak in *.pak; do
     pakname="${pak%.pak}"
     pakname="${pakname/-/_}"
     presentlang="$(chromium_lang "${pakname}")"

     # Do not issue warning for en_US locale. This is the fallback
     # locale so it should always be installed.
     if [[ "${presentlang}" == "en_US" ]]; then
       continue
     fi

     found=
     for desiredlang in ${LINGUAS}; do
       if [[ "${desiredlang}" == "${presentlang}"* ]]; then
         found=1
         break
       fi
     done

     if [[ -z ${found} ]]; then
       rm "${pak}" || die
     fi
   done

   popd > /dev/null
 fi



      reply	other threads:[~2012-02-24 16:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08 16:32 [gentoo-dev] Understanding the LINGUAS variable and use-expand Mike Gilbert
2012-02-08 17:04 ` Mart Raudsepp
2012-02-24 16:36   ` Mike Gilbert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ0EP40pan8dD1gqot59Ji32Ec6GMKVP71J=-gSBAD0rdjV-4w@mail.gmail.com' \
    --to=floppym@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox