473,395 Members | 1,977 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,395 software developers and data experts.

Get languages and culture to website?

what is the best way to make a .net (english) website viewable in other
languages, cultures?
Thanks,
Trint

Nov 17 '05 #1
4 3106
Hi Trint,

IMO, Satellite Assemblies is the best way. Here's a quick description of
what you need to do. I hope I didn't leave anything out.

In your Page_Load set Thread.CurrentThread.CurrentUICulture to
Request.Languages[0]. Then create a Satellite assembly for each locale you
want to use. Alternatively, you could set CurrentUICulture from where the
user selects a culture out of a list. Additionally, set
Thread.CurrentThread.CurrentCulture for globalization format settings such
as numbers, date/times, and currency.

In VS.NET create a *.resx file for each locale you want to support. Name
each one <YourAppName>.<locale>.resx (locale is case sensitive). When you
compile, VS.NET will create sub-directories for each satellite assembly.
The CLR is smart enough to know which directory to look at, based on the
culture you set CurrentUICulture to. Use the ResourceManager class to
extract strings based on a Name/Value pair you added to your resx files.

http://msdn.microsoft.com/library/de...ctortopic3.asp

For example, given the following:

1. My browser's locale is set to "en-US".
2. My Apps default namespace is set to "MyNamespace" (configurable through
project properties)
3. My App name is "MyAppName" (configurable through project properties)
4. I added a resx file to my project named "MyAppName.en-US.resx"
(available via Add New Item Wizard)
5. I added a name/value pair of "HelloKey" and "Hello C#!" to my resx file,
respectively.
6. The following code would emit "Hello C#!" at the top of my response
stream.

Thread.CurrentThread.CurrentUICulture = new
CultureInfo(Request.UserLanguages[0]);

ResourceManager rm = new ResourceManager("MyNamespace.MyAppName",
Assembly.GetExecutingAssembly());

string greeting = rm.GetString("HelloKey");

Response.Write(greeting);
Joe
--
http://www.csharp-station.com

"trint" <tr***********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
what is the best way to make a .net (english) website viewable in other
languages, cultures?
Thanks,
Trint

Nov 17 '05 #2
Joe,
Will this make everything on the website, let's say - in Korea, Korean
language and likewise in other countries with just what you gave in your
example? It's very important that it does.
Thanks,
Trint

.Net programmer
tr***********@gmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
No. What you can do is the check the language preference of the browser or
check the clients ip address and depending on the result change the culture.

Gabriel Lozano-Morán

"Trint Smith" <tr***********@gmail.com> wrote in message
news:O4**************@TK2MSFTNGP14.phx.gbl...
Joe,
Will this make everything on the website, let's say - in Korea, Korean
language and likewise in other countries with just what you gave in your
example? It's very important that it does.
Thanks,
Trint

Net programmer
tr***********@gmail.com

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #4
Hey, take a look at this. I believe we have a solution:

http://www.codeproject.com/aspnet/lo...sp#xx1046982xx

Thanks,
Trint

Nov 17 '05 #5

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

Similar topics

0
by: trint | last post by:
what is the best way to make a .net (english) website viewable in other languages, cultures? Thanks, Trint
10
by: Shapper | last post by:
Hello, I am working on an ASP.NET / VB web site and I need to have 2 versions: In English and French. I could create two versions of the web site by duplicating all the pages. Is that the...
2
by: Willie jan | last post by:
Hi, i want to show the current date in two languages. when i use this code it works, but i have to set the application to the culture and because this will become a function inside a...
3
by: Adrian Parker | last post by:
How do I add the Welsh language to IE6 ? And what would the ISO code be for it ? I've tried using the User Defined cy as some sites say, but the following code just uses the catch block as...
40
by: apprentice | last post by:
Hello, I'm writing an class library that I imagine people from different countries might be interested in using, so I'm considering what needs to be provided to support foreign languages,...
0
by: Magnus | last post by:
Hi, Does anyone know how to get a list of available cultures for an application? In this case I have a default texts.resx file, and some culture specific resource files texts.de.resx and...
5
by: Sajit | last post by:
Hi, Could anyone provide any suggestions on how to implement localization features for a multilingual website. Before you jump the guns, let me define the site structure a little more. We have a...
3
by: choupi | last post by:
Hi, To be able to use different languages in my application, i load into a StringDictionnary the corrrepondance between controls' names and the selected language (stored in an bdd used for the...
5
by: =?Utf-8?B?Unlhbg==?= | last post by:
Hello, I have what I thought was a simple problem, and perhaps there is still a simple solution. I have a page that is using local resource files to store all the necessary control properties on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...

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.