Imagine I have the following 2 resx files:
Resource.resx
add | add
delete | delete
edit | edit
Resource.nl.resx
add | toevoegen
delete | verwijderen
As you can see, the "nl" resource does not contain all keys of the base Resource file. When I get the values as following, I do not get all values.
var culture = Thread.CurrentThread.CurrentUICulture;
var resource = new ResourceManager(resxFileName, resourcesAssembly);
return resource.GetResourceSet(culture, true, true)
.Cast<DictionaryEntry>()
.ToDictionary(entry => entry.Key.ToString(), entry => entry.Value.ToString());
If the culture is "nl" I only get the add and delete keys, but I want it to fallback to "Resources.resx" for the edit key. Like:
add | toevoegen
delete | verwijderen
edit | edit
Is there a standard way to do this?
I could get all keys from the base resourcefile and then loop them in order to make sure I have all keys. But that seems very inefficient.