tag:blogger.com,1999:blog-15136575.post4639952877216049295..comments2023-10-17T12:00:16.772+01:00Comments on Code rant: An ASP.NET HttpModule to set the current culture to the user’s localeMike Hadlowhttp://www.blogger.com/profile/16441901713967254504noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-15136575.post-31510306181726214382012-01-05T11:59:59.053+00:002012-01-05T11:59:59.053+00:00Check this helpful link too...
Displaying User Cul...Check this helpful link too...<br /><a href="http://mindstick.com/Articles/e38373b6-55b5-4588-b999-d7bf7ffc9eea/?Displaying%20User%20Culture%20Language%20in%20ASP.Net" title="Displaying User Culture Language in ASP.Net" rel="nofollow">Displaying User Culture Language in ASP.Net </a><br /><br />Thanks!!Pravesh Singhhttps://www.blogger.com/profile/09190221713588953925noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-61863545901559514162010-11-23T07:50:20.122+00:002010-11-23T07:50:20.122+00:00Another minor optimization is use the creator meth...Another minor optimization is use the creator method CultureInfo.GetCultureInfo() to construct the culture, instead of creating a new one. The former gets the value from the pre-initialized tables.dgonhttp://dgondotnet.blogspot.comnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-77570345254091233552010-11-09T10:41:27.675+00:002010-11-09T10:41:27.675+00:00Hi sandord,
Thanks for pointing that out to me, I...Hi sandord,<br /><br />Thanks for pointing that out to me, I had no idea that that setting even existed :p<br /><br />Yes, it does look like that would do exactly the same thing.<br /><br />I'm updating the post to point this out.Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-16931988101767416322010-11-09T10:31:02.745+00:002010-11-09T10:31:02.745+00:00Hi Anonymous, Dimitris,
Yes, you are right _if_ I...Hi Anonymous, Dimitris,<br /><br />Yes, you are right _if_ I was transferring money from one user's account to another. I'm ignoring the case where parents and children could be in different countries of course.<br /><br />Of course if you are writing a serious financial application, then you need a better way to record and convert currencies.Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-65997066325349242712010-11-09T10:25:16.916+00:002010-11-09T10:25:16.916+00:00I'm with Dimitris. The currency symbol is usel...I'm with Dimitris. The currency symbol is useless as you need to convert the value. Currency type and ammount have a relationship as a pound/dollar/euro are not the same.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-12199379001479939642010-11-09T08:55:28.875+00:002010-11-09T08:55:28.875+00:00Sorry, the XML didn't show up. Here it is:
&l...Sorry, the XML didn't show up. Here it is:<br /><br /><globalization culture="auto" uiCulture="auto"/>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-60151783965418691852010-11-09T08:54:15.923+00:002010-11-09T08:54:15.923+00:00How is this any different from adding this to the ...How is this any different from adding this to the web.config file?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-45762987174857990362010-11-09T07:33:44.186+00:002010-11-09T07:33:44.186+00:00Don;t you need to convert amounts to the new curre...Don;t you need to convert amounts to the new currency too?<br /><br />DimitrisAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-70677089920824932182010-11-05T14:13:47.808+00:002010-11-05T14:13:47.808+00:00Thanks Derek, I did some more tests and you are ri...Thanks Derek, I did some more tests and you are right. I wonder why Rick had this in his original code?<br /><br />Anyway I've updated the post.Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-44808381686784184402010-11-05T13:08:44.984+00:002010-11-05T13:08:44.984+00:00I don't think you need this bit...
language =...I don't think you need this bit...<br /><br />language = language + "-" + language.ToUpper();<br /><br />You can create a CultureInfo just fine from a two letter language code e.g.<br /><br />new CultureInfo("fr").DisplayName.Dump();<br /><br />Plus you may run into an issue where using the language code as the region code results in an invalid culture.Derek Fowlerhttps://www.blogger.com/profile/09963865123124577525noreply@blogger.com