I followed this tutorial to create a resource file named GlobalResources.resx
under Resources
.
I am able to access the content of the resource file using:
string resourceVal = SPUtility.GetLocalizedString("$Resources:GlobalResources, ResourceKey", "GlobalResources", language);
However, to follow company coding standards, I am required to move the resources file into a folder named <client>.<department>.<project>.<farm|sandbox>
.
So I did this:
But now I'm not able access the resource values!
I tried the following...
(a)
SPUtility.GetLocalizedString("$Resources:Comp.Dept.Proj.Farm/GlobalResources, ResourceKey", "Comp.Dept.Proj.Farm/GlobalResources", language);
(b)
SPUtility.GetLocalizedString("$Resources:Comp.Dept.Proj.Farm\\GlobalResources, ResourceKey", "Comp.Dept.Proj.Farm\\GlobalResources", language);
(c)
SPUtility.GetLocalizedString("$Resources:Comp.Dept.Proj.Farm.GlobalResources, ResourceKey", "Comp.Dept.Proj.Farm.GlobalResources", language);
...but none of them worked.
How do I access the resource file that's not in the root of the Resources
folder?
I received an answer to this question here.
This worked: