| Author: fayaz 08 Aug 2008 | Member Level: Gold | Rating: Points: 1 |
You'd have to use Globalization and also set the proper Culture for other things in WIndows (like dates, measurements, etc).
<%@ import namespace="System.Globalization" %> <%@ import namespace="System.Threading" %> <%@ import namespace="System.Resources" %> <%@ import namespace="System.IO" %>
public override CultureInfo Parent { get { return new CultureInfo(this._parent); } }
public CustomGuamCulture(string parent, string customLanguageCode,string formalName) : base(parent) { this._parent = parent; this._name = string.Format("{0}-{1}", parent, customLanguageCode); this._description = string.Format("Custom culture ({0})", formalName); }
protected void Page_Load(object sender, EventArgs e) { CultureInfo ci; switch (Radiobuttonlist1.SelectedValue.ToString()) { // if the user selected either CHAMORRO or TAGALOG as their preference, //load the resource file for that language case "gu-CH" : case "pi-TA" : ci = new CustomGuamCulture("es-ES", Radiobuttonlist1.SelectedItem.Value.ToString(), Radiobuttonlist1.SelectedItem.Text); break; default : ci = new CultureInfo(Radiobuttonlist1.SelectedValue.ToString()); break; } Thread.CurrentThread.CurrentCulture = ci; Thread.CurrentThread.CurrentUICulture = ci;
ResourceManager rm = ResourceManager.CreateFileBasedResourceManager("resource", Server.MapPath("resources") + Path.DirectorySeparatorChar, null);
lblGreeting.Text = rm.GetString("Greeting"); lblNames.Text = rm.GetString("FirstName") + " " + rm.GetString("LastName"); lblDate.Text = DateTime.Now.ToString("D"); lblCulture.Text = "Using culture: " + ci.EnglishName; }
for more information checkout this link
http://aspnet.4guysfromrolla.com/articles/030304-1.aspx
http://www.microsoft.com/middleeast/msdn/arabicsupp.aspx
|