Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How do we get the current culture of the environment in windows and ASP.NET
How do we get the current culture of the environment in windows and ASP.NET?
✍: Guest
“CultureInfo.CurrentCulture” displays the current culture of the environment. For instance
if you are running Hindi it will display “hi-IN”. Please note one thing in mind
“CurrentCulture” will only give you the culture on which your application is running. So
if it’s a windows application this will work fine. But in ASP.NET 2.0 we need to know
what culture the end user has.
For a real international website different users can log in with different culture. For instance
you can see from the given figure below different users are logging in with different
regional settings. Client browser sends the information in the request headers to the server.
For instance a Korean user will send “KO” in the request headers to server. We can get
the value using the” Request.UserLanguages”.
Regional settings are defined on the user’s browser as shown below. Click on Tools –
Internet options – Languages. You can then add languages in the language preference
box. Using "Move up" and "Move down" you can define the priority of the languages. In
the below figure we have four languages defined with “Hindi” language set at the top
priority. ” Request.UserLanguages” returns back an array of string with the sorted order
defined in your language preference tab of the browser.
Below is the code snippet which shows how we can display the user languages. The first
figure is the code snippet which shows how to use “Request.UserLanguages”. The second
figure shows the output for the same.
One of the things to be noted is “q” value. “q” stands for quality factor. In the above
figure the quality factor means the following:
"I prefer Hindi, but will accept English US (with 80% comprehension) or Greek (with
50% comprehension) or French (with 30 % comprehension)."
Just for Non-English speakers meaning of Comprehension.
It is the process of understanding and constructing meaning from a piece of text.
The comprehension is from the perspective of the end user. It says the end browser user
will understand with this much comprehension for that language. For instance in the
above example the end browser under stands English comprehension of 80 %.
2007-11-01, 7511👍, 0💬
Popular Posts:
What is the purpose of Replication ? Replication is way of keeping data synchronized in multiple dat...
What are database triggers? How are the triggers fired? Read this collection of questions and answer...
How do I use forms? The basic syntax for a form is: <FORM ACTION="[URL]">...&l t;/FORM>Wh...
If we inherit a class do the private variables also get inherited ? Yes, the variables are inherited...
How To Manage Transaction Isolation Level? - Oracle DBA FAQ - Introduction to PL/SQL Transaction iso...