Last post Dec 14, 2007 02:34 AM by vivek_iit
Dec 10, 2007 05:04 AM|sauri|LINK
1. We have an ASP.NET 2.0 in which we set current thread's culture/locale at runtime. We have placed page.en-GB.resx and page.resx files in app_localresources folder. But when we set en-GB as the thread's culture , application is not picking the strings
from page.en-GB.resx instead it picks up the strings from page.resx. Interestingly , if we change the name of file page.en-GB.resx to page.en-US.resx and set en-GB as the culture , application recognises the file page.en-US.resx and picks up the string from
this new file.
Does anyone knows about the problem as we want to keep the file name to page.en-GB.resx.
2. Also whenever we change any key-value pair in any of the resource file , as expected application session terminates but it is observed that updated key-value pair are not reflected until we restart IIS. This behavior has been observed in some machines
while things were fine in other machines. Is this related to version of IIS/Windows. Is their any known solution for the problem so that IIS restart is not required after every change of resource file.
Dec 10, 2007 01:05 PM|vivek_iit|LINK
It seems your site is taking en-US as the default culture. How and where are you setting the culture? It seems that culture is not being set properly.
Dec 11, 2007 01:38 AM|sauri|LINK
We have overridden the Initialize culture() of Page class and set the current thread's culture to en-GB
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("en-GB");
I'm sure that the culture has been set to en-GB as the date format we are getting are in en-GB format.
Dec 13, 2007 06:12 AM|sauri|LINK
Does anyone help on the above two issues
Dec 13, 2007 03:07 PM|vivek_iit|LINK
Try using these two lines in your method:
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
Let me know if it works,
Dec 14, 2007 02:16 AM|sauri|LINK
Yes we have already used these two lines in our code. But the problem is if we have two resource files named page.en-US.resx and page.en-GB.resx and set thread's uiculture to en-GB. Application is reading resource strings from page.en-US.resx instead page.en-GB.resx
Dec 14, 2007 02:34 AM|vivek_iit|LINK
I think I would like to look at the non working code.
Can you create a sample project (remove all other code, put the code which is not working including resx files) , zip it and email me at: