Blair,

That was insightful. Thanks!

This has been implemented, see functions _getFirstLanguage(), _isFrench()
and _isDutch() at:

http://code.google.com/p/ubiquity-commands/source/browse/trunk/scripts/ebay.ubiq.js

And the diff on my ticket has been attached to the ticket ;-)

- Mayuresh

On Tue, Oct 7, 2008 at 12:05 AM, Blair McBride <[EMAIL PROTECTED]> wrote:

>
> The accepted languages list in intl.accept_languages is sent in the
> "Accept-Language" HTTP request header, when Firefox requests any
> page/file from any server. It sends the whole list all at once - and
> the site will figure out what to do (if anything). The order of the
> list is important: the closer a language is to the start of the list,
> the higher its priority is.
>
> The value stored in general.useragent.locale is only used for the
> Firefox user interface (menus, dialogs, etc). Its not sent to servers.
>
> So given Mayuresh's original use case, use intl.accept_languages.
> Given you only want to choose between 2 languages, just see which
> comes first: "fr" or "nl". Note that its possible for people to have,
> for example, "en-US" but not "en" in this list.
>
> - Blair
>
>
>
> On Tue, Oct 7, 2008 at 4:27 AM, Fernando Takai <[EMAIL PROTECTED]>
> wrote:
> > Just trying changing my intl.accept_lanaguages to "pt-br, en-us" and it
> > changes my google homepage to google.com in portuguese - so you can use
> this
> > property like this:
> >
> > function cmd_lang(){
> >    var lang = Application.prefs.get("intl.accept_languages");
> >    for each(lang in lang.value.split(",")){
> >      // try to get the site for that lang
> >    }
> > }
> >
> > Or just get the first one and use that.
> >
> > On Mon, Oct 6, 2008 at 12:13 PM, <[EMAIL PROTECTED]> wrote:
> >>
> >> I thought so too. And I am not a FF expert either. So it would be nice
> to
> >> have an authoritative answer (Mozilla Staff??) ;-)
> >>
> >> - Mayuresh
> >>
> >> On Mon, Oct 6, 2008 at 4:04 PM, Fernando Takai <
> [EMAIL PROTECTED]>
> >> wrote:
> >>>
> >>> Well, intl.acceptlanguages is a comma separated string -- you
> configured
> >>> them on preferences.
> >>> My list is: en-us,pt-br,pt,en
> >>>
> >>> So, ff will ask first for the american english site, them for the
> >>> brazilian portuguese one....
> >>>
> >>> I think ff uses first the intl.acceptlanguages and them the useragent,
> >>> but i'm not an firefox expert (yet).
> >>>
> >>> On Mon, Oct 6, 2008 at 11:50 AM, <[EMAIL PROTECTED]> wrote:
> >>>>
> >>>> On second thoughts, I found that. It seems to come from FF config.
> >>>>
> >>>> Actually that is confusing, since I have my languages set to "en-GB".
> >>>> This seems to come up in "intl.acceptlanguages". Why is this is
> different
> >>>> from the above?
> >>>>
> >>>> I guess what I am trying to know is that how do I get the language FF
> >>>> shows things in? I have noted that changing intl.acceptlanguages seems
> to
> >>>> take me to a different version of google (".co.uk" presently instead
> of
> >>>> ".com" when it was en-US)
> >>>>
> >>>> On Mon, Oct 6, 2008 at 3:44 PM, <[EMAIL PROTECTED]> wrote:
> >>>>>
> >>>>> Thanks, does this come from Ubiquity or FF? Or are they both the
> same??
> >>>>> :-)
> >>>>>
> >>>>> On Mon, Oct 6, 2008 at 3:15 PM, Fernando Takai
> >>>>> <[EMAIL PROTECTED]> wrote:
> >>>>>>
> >>>>>> You can see the FF default locale using this:
> >>>>>>
> >>>>>> function cmd_lang(){
> >>>>>>    var lang = Application.prefs.get("general.useragent.locale");
> >>>>>>    displayMessage(lang.value);
> >>>>>> }
> >>>>>>
> >>>>>> There's a way of doing that using Components but i really don't
> >>>>>> remember right now.
> >>>>>>
> >>>>>>
> >>>>>> On Mon, Oct 6, 2008 at 10:40 AM, <[EMAIL PROTECTED]> wrote:
> >>>>>>>
> >>>>>>> Hello,
> >>>>>>>
> >>>>>>> I am putting together a command for a belgian friend. The website I
> >>>>>>> am doing this for offers the French or Dutch fork right up front. I
> was
> >>>>>>> wondering how I can read FF's default language? Any hints?
> >>>>>>>
> >>>>>>>
> >>>>>>> Thanks in advance..
> >>>>>>>
> >>>>>>> --
> >>>>>>> Mayuresh
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> Fernando "Takai"
> >>>>>> http://flickr.com/photos/supeertakai
> >>>>>> http://fernandotakai.wordpress.com
> >>>>>> http://fernandotakai.jaiku.com
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> Mayuresh
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Mayuresh
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Fernando "Takai"
> >>> http://flickr.com/photos/supeertakai
> >>> http://fernandotakai.wordpress.com
> >>> http://fernandotakai.jaiku.com
> >>>
> >>>
> >>
> >>
> >>
> >> --
> >> Mayuresh
> >>
> >>
> >
> >
> >
> > --
> > Fernando "Takai"
> > http://flickr.com/photos/supeertakai
> > http://fernandotakai.wordpress.com
> > http://fernandotakai.jaiku.com
> >
> > >
> >
>
> >
>


-- 
Mayuresh

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to