Last post Dec 09, 2006 08:54 PM by rstrahl
Nov 29, 2006 10:42 PM|hapytran|LINK
See code below:
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("zh-CN");//(Request.UserLanguages); Thread.CurrentThread.CurrentUICulture =
LocRM = new ResourceManager("LocProject.strings",
Button1.Text = LocRM.GetString("txtSearch");
Label1.Text = DateTime.Now.ToString("dd-MMM-yyyy");
My label1 text is: 30-十一月-2006
I expected my web application language translated to Chinese, but do not want system date auto convert to Chinese. How can i do that?
Nov 29, 2006 11:07 PM|mbanavige|LINK
Label1.Text = DateTime.Now.ToString("dd-MMM-yyyy", CultureInfo.CreateSpecificCulture("en-US"));
Dec 09, 2006 08:54 PM|rstrahl|LINK
Hmmm... that seems kind of an odd choice. As Mike pointed out you can override the date format directly on all conversions.
In your example above you should set the CurrentUICulture, to affect resource translations. CurrentCulture affects date and number conversions.
I'd venture though that realistically you probably should have both set. Wouldn't it kind of look funky to have dates displayed in western notation in your app? IAC, the framework gives you a lot of control over what actually gets translated. You can finetune
very closely which items are translated and what values are assigned.
+++ Rick ---