I have two resource files:
Resource1.resx
and Resource1.es-mx.resx
The default system culture is en-US
.
<%@ Page UICulture="es" Culture="es-MX" %>
--> still get English version (setting language in the browser doesn't help).Resource1.es-mx.resx
to Resource1.es.resx
--> works, Spanish.<%@ Page UICulture="auto" Culture="auto" %>
, set Spanish in the browser, resource Resource1.es-mx.resx
--> Spanish.Could you explain to me what happens in the first case? Why English?
Why English? There are no Spanish country-neutral resources and you ask specifically for them. So it falls back to neutral resources (which happens to be English in your case).
You should do that the other way round: name resources file Resource1.es.resx
and ask for specific UICulture: UICulture="es-MX"
if you have to. In such case, if country-specific resources are not found, it will fall back to Spanish country-neutral resources (es).
I am not aware of your use case, but hard-coding cultures is not really good idea... You really should think about using auto here.