Regional settings

I

Ike

Is anyone aware of a means to determine the default country_local (the
iso-spec, e.g. 'en_US') for a given local computer, such as someone might
have specified in Windows under Control Panel - Regional and Language
Options ?
 
J

Jukka K. Korpela

Ike said:
Is anyone aware of a means to determine the default country_local
(the iso-spec, e.g. 'en_US') for a given local computer, such as
someone might have specified in Windows under Control Panel -
Regional and Language Options ?

What makes you think this question has the slightest connection
with HTML?

(Anyway, why don't you look at the settings, if you know where they can
be changed? You can also see the current settings there!!)

((If your question is in some mysterious way connected with HTML, the
primary answer is "Don't". That spells "you have completely misanalyzed
your problem, bud" and "tell us what you are really doing".))

(((Besides, en_US is a name for a language locale, namely the US
variant of English.)))
 
I

Ike

Trying to discern the ISO country_LOCALE codes to make a site open in the
language which is specified as the default on a local machine which IS known
by the browser, bud (where did you get that 'US variant' jingoism from
anyhow, bud?)

Given that, it is entirely POSSIBLE that this MAY be specified in a CONSTANT
somewhere, bud.

Sorry to intrude on your newgroup, bud. -Ike
 
D

Dan

Ike said:
Trying to discern the ISO country_LOCALE codes to make a site open in the
language which is specified as the default on a local machine which IS known
by the browser, bud (where did you get that 'US variant' jingoism from
anyhow, bud?)

Why don't you use the HTTP "Accept-Language" header, which is actually
designed for that particular purpose, rather than trying to reinvent
this wheel by attempting to determine other, only partially-related,
system settings that have nothing intrinsically to do with the Web?

More info: http://webtips.dan.info/language.html

Don't top-post. http://mailformat.dan.info/quoting/top-posting.html
 
A

Andy Dingley

Is anyone aware of a means to determine the default country_local

As an approximation this is probably in the headers of the HTTP request,
as a list in the Accept-Language header. Read the RFC for details of how
these are encoded.

Be aware that these are browser settings, probably derived from the OS
settings at the time and for the user who first installed the browser.
They may be far from accurate.

With some simple scripting on the server, it's easy to control the
site's behaviour on the basis of this header. But remember that they're
unreliable, particularly for multiple users on the same machine. Use
them to drive defaults, by all means, but always allow the user to
choose a different language and overwrite these settings.
 
J

Jukka K. Korpela

Ike said:
Trying to discern the ISO country_LOCALE codes to make a site open
in the language which is specified as the default on a local
machine which IS known by the browser, bud

I sort-of knew that's what you had in your mind. What you wrote was
completely different.

This is a common case of taking much trouble to create problems by
using wrong tools to address the wrong problem.
(where did you get that
'US variant' jingoism from anyhow, bud?)

I know what I'm talking about; you don't.
Given that, it is entirely POSSIBLE that this MAY be specified in a
CONSTANT somewhere, bud.

You really have no clue.
Sorry to intrude on your newgroup, bud. -Ike

The exit door is there ==========>.

Thank you in advance. Have a nice day. The reason for not telling the
right question and the right answer is that you are clearly not
prepared to trying to understand them. Of course, you also misbehave
and act as a fool, but I treat that just as one evidence of your
decidedness to remain ignorant.
 
I

Ike

I'll just do it as an applet, write it as a cookie, read it in that way. I
thought there was a more html-centric way to discern this, evidently not.
Glad I got under your skin tho, Jukka, and if you ever happen to wander into
the Java groups, I'll be looking for you too. -Ike
 
D

Daniel R. Tobias

Ike said:
I'll just do it as an applet, write it as a cookie, read it in that way. I
thought there was a more html-centric way to discern this, evidently not.
Glad I got under your skin tho, Jukka, and if you ever happen to wander into
the Java groups, I'll be looking for you too. -Ike

Why not just use HTTP language negotiation with the "Accept-Language"
header?
 
A

Andy Dingley

(where did you get that 'US variant' jingoism from
anyhow, bud?)

"en" is English (the ISO 639 series for languages)

"en_US" is "American English", the concatenation of the ISO 639 language
code and something that might be an ISO 3166 country code. It could also
contain x_klingon, en_geordie, or la_sci

HTTP doesn't care about "country locale" as a desktop OS might. It just
doesn't care where you're doing it from, only what language you might
want to do it in.

If you sniff for exact matches on language code alone, then my browser
will send you an en_GB that you might incorrectly ignore, because it
doesn't contain "US"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top