I've created two .resx files - WebResources.resx and WebResources.fr-FR.resx.
Both contain ExceptionMessages_SignupWithCard.
To test I did:
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
Response.Write("Current Culture is " + CultureInfo.CurrentCulture.EnglishName);
Response.Write("<br>Message is: " + Resources.WebResources.ExceptionMessages_SignupWithCard);
The problem is that I still get the ExceptionMessages_SignupWithCard message from WebResources.resx and not the one from WebResources.fr-FR.resx .
Can someone please assist?
Thanks.
ASP.Net (specifically, the ResourceManager
) uses CurrentUICulture
to retrieve resources.
Try setting the Thread's CurrentUICulture as well.
CultureInfo french = new CultureInfo("fr-FR");
Thread.CurrentThread.CurrentCulture = french;
Thread.CurrentThread.CurrentUICulture = french;
Response.Write("Current Culture is " + CultureInfo.CurrentCulture.EnglishName);
Response.Write("<br>Message is: " +
Resources.WebResources.ExceptionMessages_SignupWithCard);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With