C # - ResourceManager and ResourceSet give me an empty or null result
I am currently working on resource files to translate some text.
I have basic "RevitString.resx" and "RevitString.fr-FR.resx". They both have the same keys with translated meanings and are publicly available.
I want to use them inside my C # code with the following code:
ResourceSet resourceSet = Resources.Languages.Tables.RevitString.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
type = (from ResourceDictionary x
in resourceSet
where x.Keys.ToString() == _type.Definition.ParameterGroup.ToString()
select x.Values.ToString()).FirstOrDefault();
But when I run this I got a null ResourceSet and when I look at the ResourceManager the "ResourceSets" is empty with count = 0.
What have I done wrong?
I already have posts like this
Thank!
+3
source to share
1 answer
Thanks to GibralterTop for giving me a good link.
Here's what I know.
ResourceSet resourceSet = Resources.Languages.Tables.RevitString.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
IDictionaryEnumerator enumerator = resourceSet.GetEnumerator();
while (enumerator.MoveNext())
{
switch(enumerator.Key)...
+1
source to share