Search code examples
c#internationalizationresx

resx files - remove default file with no language


I've got a App_GlobalResources folder with a different resource file per culture:

Resource.en-gb.resx
Resource.fr-fr.resx
.
.
Resource.resx

It looks like this last Resource.resx "default" file with no language associated with it has to exist there by design.

Is there a way to get rid of this last default file without breaking the code?


Solution

  • Yes, this is by design. Asp.Net uses the

    Thread.CurrentThread.CurrentCulture and Thread.CurrentThread.CurrentUICulture 
    

    to identify the present culture. It looks for resource file which has associated culture in the above property. If the associated file is not found then, it will fallback to the default language's resource. So make sure this file is part of your installer.

    good luck...