473,766 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ServerVariables & Language Preferences Support

I'm messing around with the Request.UserLan guages and the
Request.ServerV ariables("HTTP_ ACCEPT_LANGUAGE "); to see
how similar or dissimilar they may be.

I observe and conclude that both get their value from the Accept-Language
key stored in the header of the response. To test this hypothesis I
reconfigure IE Language Preferences which by default (for me)
is English (United States)[en-us].

I include a Spanish (Mexico)[es-mx] Language Preference and
use the Language Preferences tool to move the Spanish selection
to the top of the Language Preferences list.

I load a page with a couple of Response.Write statements and see the
following written to the page...

HTTP_ACCEPT_LAN GUAGE: es-mx,en-us;q=0.5
User Language 0: es-mx
User Language 1: en-us;q=0.5

So, I ask myself what the heck is this q=0.5 name=value pair?

I go back to Language Preferences and feel like a freedom fighter
so I add Arabic(Iraq)[ar-iq] and this is what is written to the page...

HTTP_ACCEPT_LAN GUAGE: es-mx,en-us;q=0.7,ar-iq;q=0.3
User Language 0: es-mx
User Language 1: en-us;q=0.7
User Language 2: ar-iq;q=0.3

So, now I'm asking, "what the heck does this q sh!t mean and why the
inconsistent values?"

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/
Nov 18 '05 #1
3 2412
Interesting. Here's what my version of IE is sending:

HTTP_ACCEPT_LAN GUAGE:en-us,en-ca;q=0.7,fr-ca;q=0.3

Is it inconsistent? Anyway, I'll ask around to see what the q stuff is all
about.

Ken
"clintonG" <csgallagher@RE ************@me tromilwaukee.co m> wrote in message
news:uu******** ******@TK2MSFTN GP09.phx.gbl...
I'm messing around with the Request.UserLan guages and the
Request.ServerV ariables("HTTP_ ACCEPT_LANGUAGE "); to see
how similar or dissimilar they may be.

I observe and conclude that both get their value from the Accept-Language
key stored in the header of the response. To test this hypothesis I
reconfigure IE Language Preferences which by default (for me)
is English (United States)[en-us].

I include a Spanish (Mexico)[es-mx] Language Preference and
use the Language Preferences tool to move the Spanish selection
to the top of the Language Preferences list.

I load a page with a couple of Response.Write statements and see the
following written to the page...

HTTP_ACCEPT_LAN GUAGE: es-mx,en-us;q=0.5
User Language 0: es-mx
User Language 1: en-us;q=0.5

So, I ask myself what the heck is this q=0.5 name=value pair?

I go back to Language Preferences and feel like a freedom fighter
so I add Arabic(Iraq)[ar-iq] and this is what is written to the page...

HTTP_ACCEPT_LAN GUAGE: es-mx,en-us;q=0.7,ar-iq;q=0.3
User Language 0: es-mx
User Language 1: en-us;q=0.7
User Language 2: ar-iq;q=0.3

So, now I'm asking, "what the heck does this q sh!t mean and why the
inconsistent values?"

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/


Nov 18 '05 #2
Here's the explanation that I got from a fellow MVP regarding the "q" part:

Quality - indicates a level of your preference for a particular choice.
A number between 0.0 and 1.0, 0.0 being "never want to use this". If the
server has content in multiple languages that your Accept-Language
header also lists, the server should choose the one with the highest q
number. See RFC2616 for more details:

http://www.faqs.org/rfcs/rfc2616.html
"clintonG" <csgallagher@RE ************@me tromilwaukee.co m> wrote in message
news:uu******** ******@TK2MSFTN GP09.phx.gbl...
I'm messing around with the Request.UserLan guages and the
Request.ServerV ariables("HTTP_ ACCEPT_LANGUAGE "); to see
how similar or dissimilar they may be.

I observe and conclude that both get their value from the Accept-Language
key stored in the header of the response. To test this hypothesis I
reconfigure IE Language Preferences which by default (for me)
is English (United States)[en-us].

I include a Spanish (Mexico)[es-mx] Language Preference and
use the Language Preferences tool to move the Spanish selection
to the top of the Language Preferences list.

I load a page with a couple of Response.Write statements and see the
following written to the page...

HTTP_ACCEPT_LAN GUAGE: es-mx,en-us;q=0.5
User Language 0: es-mx
User Language 1: en-us;q=0.5

So, I ask myself what the heck is this q=0.5 name=value pair?

I go back to Language Preferences and feel like a freedom fighter
so I add Arabic(Iraq)[ar-iq] and this is what is written to the page...

HTTP_ACCEPT_LAN GUAGE: es-mx,en-us;q=0.7,ar-iq;q=0.3
User Language 0: es-mx
User Language 1: en-us;q=0.7
User Language 2: ar-iq;q=0.3

So, now I'm asking, "what the heck does this q sh!t mean and why the
inconsistent values?"

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/


Nov 18 '05 #3
Thanks Ken. Convey my appreciation to your colleague. I'll get around
to reading the RFC. Meanwhile, we know by 'general consensus' that
the language preference settings sent by the user agent are not supposed
to be reliable indicators that can be used to modify page output
(server settings over-ride the user agent) but the server-centric point of
view fails to account for the user's preferences should he or she want to
read content in pages a site operator chose to make available in
different languages regardless.

Preparing to achieve the MCAD cert I've seen two 'correct' answers
regarding how to determine preferences. The first advocates using a
DropDownList to allow the user to select their preference (Kalani,
QUE 70-315). The second advocates getting the preferences from
the request object (Transcender).

Besides thinking through my own design and implementation for a
project I am working on I'm conflicted regarding how to approach
70-315 with two opposing 'correct' answers proferred by two seemingly
equal authoritative sources.

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/


"Ken Cox [Microsoft MVP]" <BA************ @sympatico.ca> wrote in message
news:OE******** ******@TK2MSFTN GP11.phx.gbl...
Here's the explanation that I got from a fellow MVP regarding the "q" part:

Quality - indicates a level of your preference for a particular choice.
A number between 0.0 and 1.0, 0.0 being "never want to use this". If the
server has content in multiple languages that your Accept-Language
header also lists, the server should choose the one with the highest q
number. See RFC2616 for more details:

http://www.faqs.org/rfcs/rfc2616.html
"clintonG" <csgallagher@RE ************@me tromilwaukee.co m> wrote in message
news:uu******** ******@TK2MSFTN GP09.phx.gbl...
I'm messing around with the Request.UserLan guages and the
Request.ServerV ariables("HTTP_ ACCEPT_LANGUAGE "); to see
how similar or dissimilar they may be.

I observe and conclude that both get their value from the Accept-Language
key stored in the header of the response. To test this hypothesis I
reconfigure IE Language Preferences which by default (for me)
is English (United States)[en-us].

I include a Spanish (Mexico)[es-mx] Language Preference and
use the Language Preferences tool to move the Spanish selection
to the top of the Language Preferences list.

I load a page with a couple of Response.Write statements and see the
following written to the page...

HTTP_ACCEPT_LAN GUAGE: es-mx,en-us;q=0.5
User Language 0: es-mx
User Language 1: en-us;q=0.5

So, I ask myself what the heck is this q=0.5 name=value pair?

I go back to Language Preferences and feel like a freedom fighter
so I add Arabic(Iraq)[ar-iq] and this is what is written to the page...

HTTP_ACCEPT_LAN GUAGE: es-mx,en-us;q=0.7,ar-iq;q=0.3
User Language 0: es-mx
User Language 1: en-us;q=0.7
User Language 2: ar-iq;q=0.3

So, now I'm asking, "what the heck does this q sh!t mean and why the
inconsistent values?"

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1883
by: Erwin Moller | last post by:
Hi group, I am a bit cconfused with the different tags I encounter to start a script. I used to use: language="Javascript" Nowadays I use: type="text/javascript" I did see some javascript1.2 (i think) too, but never used that. But when I let my favorite editor (Eclipse) do some codecompletion I get:
115
7635
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical transform function. When compiling under gcc on my big-endian PowerPC (Mac OS X), declaring this array as "static" DECREASES the transform throughput by around 5%. However, declaring it as "static" on gcc/Linux/Intel INCREASES the throughput by...
72
4230
by: Paminu | last post by:
In math this expression: (a < b) && (b < c) would be described as: a < b < c But why is it that in C these two expressions evaluate to something different for the same values of a, b and c?
0
1983
by: Enzo | last post by:
Hello, I am trying to add items to the ServerVariables Collection for some custom processing. In the past this needed to be done with an ISAPI filter. I am told now that I can do this with a class file that implements IHTTPModule. Below is my code but I can't get it to work. I don't get any errors but I don't get any headers added to my collection either. Let me note that I have added the correct data to the web.config file and the...
11
2423
by: Tom | last post by:
I am planning on adding a Preferences form to my application and using the Property Grid to display the preferences to the user. What do you think would be the best way to save these preferences out to an XML file? Use the CAB (Configuration Application Block)? Save the preferences in a class object and serialize them out the the XML file? Write them out directly to the XML file? Other ways??? Just want to get some thoughts together......
10
10790
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language Aquisition Device (2) Color Aqusition Device (3) Sound Aquistion Device (4) Smell Aquisition Device (5) Touch Aquisition Device (6) Art Aquisition Device
3
4459
by: gg | last post by:
I specify the Url element as <xsd:element name="Url"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="512"/> <xsd:pattern value="http://+"/> </xsd:restriction> </xsd:simpleType> </xsd:element> in the xsd but When I use the following in the xml
6
6587
by: plenty900 | last post by:
Hi folks, I've altered the PHP underlying a website to support a few languages other than English, but the Firefox version that I'm using is of course the English-language one. When I set the language in the preferences e.g. to French, the website still thinks the browser is English. Is there a way to properly change the browser language? Thanks.
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.