473,383 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Culture Questions. en-US.

Hello,

I am working on a multi-language web site.
After a lot of searching and reading I was able to define a way to do
this.

However, I need some help to put this on. I am working on ASP.Net/VB.

I have a few problems which I hope somebody can help me with:
1. How to set the en-US as the default culture of my entire web site?
2. How to detect the culture of a visitor browser and overwrite the
default?
If the user has a cookie placed by my web site I will use that one.
3. How to create a function (can be ran when a button is clicked) which:
3.1. Sets a new culture.
3.2. Places a cookie indicating which cookie is used.
3.3. Refreshes current page and uses the new culture used.
4. How can I retrieve in a ASPX page which culture is in use.

I have the plan. The problem is how to this.

Can someone help me out?

Thank You Very Much,
Miguel

Nov 19 '05 #1
3 3638
Some of the answers

To get and set the culture:

For default culture en-US:

<configuration>
<system.web>
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-US"
uiCulture="de-US"
/>
</system.web>
</configuration>

To set a new culture in an ASPX page:

<%@ Import Namespace="System.Threading" %>
....
Thread.CurrentThread.CurrentCulture = new CultureInfo("nl-BE")
....

To retrieve the culture in an ASPX page:
<%@ Import Namespace="System.Threading" %>
....
CultureInfo.CurrentCulture
or
Thread.CurrentThread.CurrentCulture
Gabriel Lozano-Morán
Nov 19 '05 #2
Gabriel.

What is the uiCulture?

Thanks,
Miguel

P.S: Does anyone knows about the rest? Thanks.

"Gabriel Lozano-Morán" <ga************@no-spam.com> wrote in message
news:ga************@no-spam.com:
Some of the answers

To get and set the culture:

For default culture en-US:

<configuration>
<system.web>
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-US"
uiCulture="de-US"
/>
</system.web>
</configuration>

To set a new culture in an ASPX page:

<%@ Import Namespace="System.Threading" %>
...
Thread.CurrentThread.CurrentCulture = new CultureInfo("nl-BE")
...

To retrieve the culture in an ASPX page:
<%@ Import Namespace="System.Threading" %>
...
CultureInfo.CurrentCulture
or
Thread.CurrentThread.CurrentCulture
Gabriel Lozano-Morán


Nov 19 '05 #3
culture = default culture for processing incoming Web requests.
uiCulture = default culture for processing locale-dependent resource searches.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
Gabriel.

What is the uiCulture?

Thanks,
Miguel

P.S: Does anyone knows about the rest? Thanks.

"Gabriel Lozano-Morán" <ga************@no-spam.com> wrote in message
news:ga************@no-spam.com:
Some of the answers

To get and set the culture:

For default culture en-US:

<configuration>
<system.web>
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-US"
uiCulture="de-US"
/>
</system.web>
</configuration>

To set a new culture in an ASPX page:

<%@ Import Namespace="System.Threading" %>
...
Thread.CurrentThread.CurrentCulture = new CultureInfo("nl-BE")
...

To retrieve the culture in an ASPX page:
<%@ Import Namespace="System.Threading" %>
...
CultureInfo.CurrentCulture
or
Thread.CurrentThread.CurrentCulture
Gabriel Lozano-Morán

Nov 19 '05 #4

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

Similar topics

4
by: bruce_taylor | last post by:
Please forgive me if this is a little off topic, but I'm trying to reach a population of active programmers and this newsgroup is an popular gathering place. I am conducting research on the...
2
by: Aliasgar Pocketwala | last post by:
Hi, I have an asp.net application that is using the wrong culture. I cant figure out where does it get its setting from. My web application runs as a specific user since so that I can give it...
1
by: Chris Porter | last post by:
Just as I thought I was understanding doing timezone offsets I ran the following code : CultureInfo en = new CultureInfo("en-GB"); Thread.CurrentThread.CurrentCulture = en;...
3
by: Ashish | last post by:
I have a application in which culture settings are customizable, they dont depend on the machine settings on which the application is running, I need to make sure that all the threads running in...
0
by: Jim Heavey | last post by:
I have downloaded some code and incorporated this code into my program (not much of a program...all of 3 lines..). When I compile and run, I get the following "Could not find any resources...
3
by: Ian O'Rourke | last post by:
Okay, I have a problem with the en-GB culture object My computer is set to the UK and for UK date formats, etc If I set my culture to en-GB in the web.config everything works fine with UK dates...
1
by: Ya Ya | last post by:
I am developing a DLL (class library) for a web application of mine. In the web.config of the web application I have set: culture="en-GB" uiCulture="en" in order that the date format will be...
0
by: Luis Esteban Valencia | last post by:
Hello I have this error when I submit the page with the following code. I had never see this kind of errors. Thanks private void btnsubmit_Click(object sender, System.EventArgs e) { ...
4
by: Henke | last post by:
Hi I'm building an globalized application (english, swedish and russian languages) and have a few questions: 1. In order to see the russian characters correct I have to set the requestEncoding...
0
by: kidders | last post by:
Seem to be having problems with the en-GB culture/uiCulture setting, its making dates a format of the incorrect MM/dd/yyyy. I've searched the groups on this issue, here is a lengthy thread, where...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.