Last post Nov 21, 2006 03:39 PM by rstrahl
Nov 20, 2006 01:52 PM|mcanic|LINK
Hi it must be easy but I can't get this to work.
I put a label and a button on a page and selected 'Generate local resource' from the tools menu. I renamed the default.aspx.resx file to default.aspx.nl-NL.resx. I put this in the aspx page directive:
Now when I run the page, the control properties are not filled with the values from the resx file. It only works when the resx file is called default.aspx.resx.
Does anyone know what I am doing wrong?!?
Nov 21, 2006 03:30 AM|JohanNL|LINK
you can test what the app has for culture settings.
Nov 21, 2006 04:48 AM|mcanic|LINK
Hi thanks for your answer. I already tried to set the culture programatically (I tried to use the InitializeCulture sub and alsot the page_Load):
System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("nl-NL")
System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("nl-NL")
Nov 21, 2006 03:39 PM|rstrahl|LINK
You need to make sure you leave the invariant culture in place, ya? If you renamed the file you will have problems - you need to copy it so that you have:
ASP.NET uses resource fallback and for local resources at least (those that use meta:resourcekey) it looks at the Invariant culture to find which keys it can publish at compile time. So the invariant culture - even if you don't need it is crucial.
If dutch is your primary language you can also make it your invariant language in which case you wouldn't have to create any secondary language resource file.
+++ Rick ---