views:

215

answers:

1

We are working on a ASP.NET project and we are using the resx files to implement the internationalization.

Although, it only compiles when I create the default resource file (Page.ascx.resx for instance). It doesn't let us to use only culture-specific files (like Page.ascx.en-US.resx, Page.ascx.km-KH.resx, Page.ascx.pl-PL.resx, etc.)

I already used the following assembly attribute. It lets me compile, but I get a runtime error.

[assembly: NeutralResourcesLanguageAttribute("km-KH",UltimateResourceFallbackLocation.Satellite)]

Any sugestions?

Thanks!

+2  A: 

No, I don't think so - the basic assumption with resources files is that there's always a fallback strategy: if you look for "German (Switzerland)" which is de-CH and find it, it will be used. If it's missing, it'll look for the "generic" German which is "de" and use that, and if even that fails, there's always the basic standard resx file to fall back on.

The default resx (without any culture like "de-CH") will be compiled into your default assemblies, so that your app will work even if none of the language- and culture-specific satellite assemblies are present.

This is really a fundamental design assumption deep inside the ASP.NET system, so I wouldn't try and "fight" against that system - adopt it, and get used to it. It'll be easier in the long run.

Marc

marc_s