Search code examples
wpfdefaultcultureresx

How do I tell my application which resx file to use when it is passed a culture it doesn't understand? (WPF)


Subject says it all. I have Resources.en-US.resx, Resources.de-DE.resx, etc. I don't ever want the basic Resources.resx file to be referenced. If someone passes me a language that I don't have a resx for I want it to drop back and use Resources.en-US.resx. Anyone?


Solution

  • Use the NeutralResourcesLanguageAttribute:

    [assembly: NeutralResourcesLanguageAttribute("en-US" , UltimateResourceFallbackLocation.Satellite)]