We developed an application that loads specific .dll files which are then used as plugins. The app itself has multiple .resx-files which are used for localization.
Titles.resx
Titles.de-DE.resx
Titles.it-IT.resx
These files are loaded via Prism and LightInject
_container.RegisterSingletonFluent<TitlesLocalizer>();
public class TitlesLocalizer : LocalizerBase
{
public TitlesLocalizer()
{
ResourceManagerStringLocalizerFactory factory = new ResourceManagerStringLocalizerFactory(new OptionsWrapper<LocalizationOptions>(new LocalizationOptions()), new NullLoggerFactory());
Localizer = factory.Create(typeof(Properties.Titles));
}
}
public class TitlesLocalizer<T> : LocalizerBase<T>
{
public TitlesLocalizer()
{
ResourceManagerStringLocalizerFactory factory = new ResourceManagerStringLocalizerFactory(new OptionsWrapper<LocalizationOptions>(new LocalizationOptions()), new NullLoggerFactory());
Localizer = factory.Create(typeof(T));
}
}
The localization of the app itself works as expected. All Plugins come with their own localization resources which are loaded via the generic localization:
_container.RegisterSingletonFluent<TitlesLocalizer<Properties.Titles>>();
The problem is, that inside the plugin, only the neutral language is being loaded. I checked the culture via breakpoint and it's still the one i want to use (German for example). I don't know what prevents the correct localization, so maybe someone got an idea what I do possibly wrong. Thanks in advance for any help! PS: If you need more code, just tell me. I will provide as much as I am allowed to
EDIT1: After testing a lot, I found the issue. When building the plugin project, it creates folders for "de-DE", "it-IT", ... . Inside there are the localization dlls. The Plugin itself will be copied to the apps build directory under "App/Plugins/PluginX". The problem is, that the app can only load the localization files, if they are inside "App/de-DE/".
So is there a way to load those .dll files, even if they are inside a subfolder like "App/Plugins/PluginX/de-DE/" ?