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

web page in 2 languages

I have a web site that needs to exist in English and German. I certainly
could write it twice in both languages (one page for each language), but
what is the preferred method for multiple languages? I could be required
later to add a few more.

Thanks,
Eric
Nov 18 '05 #1
1 1097
On Thu, 29 Jul 2004 14:51:39 -0400, "Eric Sabine" <mopar41@hyotyt_mail_nounderscores.com> wrote:
I have a web site that needs to exist in English and German. I certainly
could write it twice in both languages (one page for each language), but
what is the preferred method for multiple languages? I could be required
later to add a few more.

Thanks,
Eric

Make all your text into labels. and then use a business layer class to read from the proper resx to fill out the label.text. Here is an
example of a localization class.

public class L10n
{
private static ResourceManager resourceManager = new ResourceManager("Business.L10n", Assembly.GetExecutingAssembly());
private static CultureInfo ci;

static L10n()
{
ci = GetCurrentCulture();
}

public static string GetString(string key)
{
resourceManager.IgnoreCase = true;
string text = resourceManager.GetString(key, ci);
if (text == null)
{
text = "String not found";
}
return text;
}

public static CultureInfo GetCurrentCulture()
{
string language = GetCurrentLanguageSetting();

switch (language.ToUpper())
{
default:
case "ENU":
return new CultureInfo("en-us");
case "CHS":
return new CultureInfo("zh-CN");
case "CHT":
return new CultureInfo("zh-TW");
case "FRA":
return new CultureInfo("fr-FR");
case "DEU":
return new CultureInfo("de-DE");
case "ITA":
return new CultureInfo("it-IT");
case "JPN":
return new CultureInfo("ja-JP");
case "PTB":
return new CultureInfo("pt-BR");
case "ESP":
return new CultureInfo("es-ES");
}
}
}
Bobby Ryzhy
bobby @ domain below
http://weekendtech.net
Nov 18 '05 #2

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

Similar topics

7
by: WindAndWaves | last post by:
Hi Gurus I am keen to make a search page on a website, but I have absolutely zero experience with PHP. I am going to hire an expert, but I thought that it may pay to try it a bit first myself...
179
by: SoloCDM | last post by:
How do I keep my entire web page at a fixed width? ********************************************************************* Signed, SoloCDM
1
by: Varsha | last post by:
Hi, How can I display characters from different character sets on the same HTML page? How to simultaneously display multiple languages on the same page. I am using div tag to display source and...
4
by: Sasha | last post by:
Hi, I need to send xml file to an asp page.. I have no idea how to do it... I only know that I need to do HTTPRequest Post... Could someone help? Maybe there are some examples on the Web? ...
2
by: Fabrizio | last post by:
HI, i need to pass a value from a Web Page to another in ASP.NET, eg. i want to keep the user name from a login page and diplay to next page . What should I use? Thanks, fabrizio
6
by: mae | last post by:
I have created 2 ASP pages that gives users the option of switching back and forth between French and English. They click on the word English and it converted the text to English and the French...
8
by: TS | last post by:
Im in a web page and call an asynchronous method in business class. the call back method is in the web page. When page processes, it runs thru code begins invoking the method then the page...
3
by: fiefie.niles | last post by:
I would like to save a web page to a file. When I do that, sometimes the saved web page does not look like the original web page. For example, when I save www.msn.com, it looks very different the...
2
by: pankajsingh5k | last post by:
Dear All, Please help me... I had read an article to lazy load a tab in a tabcontainer using an update panel on http://mattberseth.com/blog/2007/07/how_to_lazyload_tabpanels_with.html ...
5
by: rahullko05 | last post by:
Hi, I am developing forum website as my final year project. I am having problem in generating different URLs but keeping the same page.. Scenario: I am showing threads for different languages in...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.