tags:

views:

625

answers:

4

I want to have my ASP C# application to be multi-language. I was planned to do this with a XML file. The thing is, i don't have any experience with this. I mean how, do i start? Is it a good idea to store the languages in an xml file? And how in the code do i set the values for ie my menu buttons? I'd like to work with XML because i never worked before with XML, i want to learn how to deal with cases like this.

+1  A: 

Do you know about the .Net From automatic translatation (based on .resx) resources ?

No i don't. Does that automatically translate my menu items, labels and so on?
Martijn
They (resource files) will contains your translated string, so you can use it accordingly
abatishchev
Yes,It's XML based. Good point is that you can also add non-UI elements,and get them in your app, when you need.Example : I store error messages there, and get them if needed.Notice: on runtime, they are compiled as dll
+7  A: 

You want to look into RESX resource files. These are XML files that can contain texts (and images) and they have standardized handling of localization/translations.

Support for this is built right into ASP.NET. There is a guide for how to use it and set it up at: http://msdn.microsoft.com/en-us/library/fw69ke6f(VS.80).aspx.

The walkthough is pretty detailed and should help you to understand the concepts. My preferred is method described a bit down in the document in the section "Explicit Localization with ASP.NET". Using this you will get a set of XML files with your texts and translations in a fully standardized format.

Thomas Petersen
You took the lead with that link )
abatishchev
A: 

You're in luck, this sort of stuff is built directly into .Net

The way it's done is that for every page you have a language specific resx file.

eg

Homepage.aspx Homepage.aspx.cs Homepage.aspx.en.resx Homepage.aspx.fr.resx

you simply dynamically figure out what resource file to use, and all the appropriate labels come through in French for example.

Helpful Tutorials and Videos

A Simple Example

Good luck.

danswain
A: 

If internationalization in .net is something you want to get into seriously, you might want to consider this (and no - I have no stake in it)

Yossi Dahan