Thanks for the "resources", I will look into that.
For Property.. this is what I meant, for example I am creating a Person
class:
public class Person
{
private string _FirstName;
public FirstName(string myFirstName)
{
_FirstName = myFirstName;
}
}
In ASP.NET, string, by default doesn't support multi-languages.
Person myPerson = new Person();
myPerson.FirstName("John");
// I want to do something like this:
myPerson.FirstName("Le John", new CultureInfo("fr-FR"));
myPerson.FirstName("John", new CultureInfo("en-US"));
My solution is to implement this by using Hash Table and Methods (not using
Properties), by putting CultureInfo name as the key of hashtable. It works,
but not sure if that's the best way. What do you think? Does ASP.NET has a
better way?
public class FirstName
{
private Hashtable _FirstName = new Hashtable();
public string GetFirstName(CultureInfo myCulture)
{
return _FirstName[myCulture.Name].ToString();
}
public void SetFirstName(string myFirstName, CultureInfo myCulture)
{
_FirstName[myCulture.Name] = myFirstName;
}
}
C.P.
"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I will break this down into two parts :
- fixed strings for the UI could be taken from resources files. .NET
provides support for this. You could also take those values from a DB
(likely cached) or some other location in particular if translation should
be updatable "live" by someone... You'll have support for this in .NET
2.0. See the doc for "resources".
- I'm not really sure about what you meant by the second part. If you
meant by the "property", a "data" entered by the user there is little you can
do. Either the application insulates each group of users (for example the app
manages multiple projects using each an official language). If not, the
data model for your application will have to make provision so that users are
able to entered a localized version for each of their "data"...
Patrice
--
"00_CuMPe3WaR3D12" <00**************@yahoo.com> a écrit dans le message de
news:pd********************@rogers.com... I know there is Culture feature with Asp.net, but what I want to know
is how to organize/design a web application that supports multiple
languages. What is the best approach? Do I use "If, then.." to display one block
of HTML in English, and then another block in French? Is there an easy way?
Also, "string" itself doesn't support multiple cultures, right? If I
write a "string" property in a class, how do I make the property support
multiple cultures?