Reputation: 24789
I just started using explicit resource files. I performed these steps:
In the root create the folder: App_GlobalResources
Add two resx files: LocalizedText.en-us.resx
and LocalizedText.resx
In both files I have a value called 'InstitutionTitle
'
In LocalizedText.en-us.resx
the value is 'Institution
' and in the LocalizedText.resx
the value is 'Instelling
'
In my .aspx
file I have the following label:
<asp:Label ID="lblInstitution" runat="server" Text="<%$ Resources:LocalizedText, InstitutionTitle %>" />
When I run this page, I always get the dutch version. Whether I set the language in my browser (FF and IE7) or not, I always get the dutch version. When I request the browsers' language I get en-us
(using: Response.Write(Request.Headers["Accept-Language"]);
).
What's the issue and how can I fix it?
Upvotes: 2
Views: 2090
Reputation: 96571
Setting the language preferences in the browser is not enough. You have to make sure that the current thread's Culture and UICulture properties are set accordingly in ASP.NET.
You can do this either programmatically or declaratively on your page (Culture and UICulture attributes of the <%@Page %> directive).
Or you can let ASP.NET set them automatically by setting the web.config entry shown below and setting the Culture/UICulture properties of the page/masterpage to "auto".
// web.config:
<globalization enableClientBasedCulture="true" ...>
// page/masterpage:
<%@ Page ... Culture="auto" UICulture="auto" %>
Check this page for details.
Upvotes: 2
Reputation: 5730
@martijn:
check the browsers caching settings. Caching should be off all the time when developing.
Install Firebug (FF) and Fiddler(IE) to see what's being transfered over the wire.
Hope this helps...
signed,
A fellow countryman
Upvotes: 0