Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to access a resource file that's not in the root of the Resources folder? (Sharepoint 2010)
    primarykey
    data
    text
    <p>I followed <a href="http://blogs.msdn.com/b/johnwpowell/archive/2009/11/29/sharepoint-2010-localization-with-visual-studio-2010.aspx" rel="nofollow noreferrer">this</a> tutorial to create a resource file named <code>GlobalResources.resx</code> under <code>Resources</code>.</p> <p><img src="https://i.stack.imgur.com/lwbB6.png" alt="Resources file in root"></p> <p>I am able to access the content of the resource file using:</p> <pre><code>string resourceVal = SPUtility.GetLocalizedString("$Resources:GlobalResources, ResourceKey", "GlobalResources", language); </code></pre> <p><br/> However, to follow company coding standards, I am required to move the resources file into a folder named <code>&lt;client&gt;.&lt;department&gt;.&lt;project&gt;.&lt;farm|sandbox&gt;</code>.<br> So I did this:</p> <p><img src="https://i.stack.imgur.com/CxUSb.png" alt="Resource file in sub-folder"></p> <p>But now I'm not able access the resource values! </p> <p>I tried the following...</p> <p>(a)</p> <pre><code>SPUtility.GetLocalizedString("$Resources:Comp.Dept.Proj.Farm/GlobalResources, ResourceKey", "Comp.Dept.Proj.Farm/GlobalResources", language); </code></pre> <p>(b)</p> <pre><code>SPUtility.GetLocalizedString("$Resources:Comp.Dept.Proj.Farm\\GlobalResources, ResourceKey", "Comp.Dept.Proj.Farm\\GlobalResources", language); </code></pre> <p>(c)</p> <pre><code>SPUtility.GetLocalizedString("$Resources:Comp.Dept.Proj.Farm.GlobalResources, ResourceKey", "Comp.Dept.Proj.Farm.GlobalResources", language); </code></pre> <p>...but none of them worked. </p> <p><strong><em>How do I access the resource file that's not in the root of the</em></strong> <code>Resources</code> <strong><em>folder?</em></strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload