In ASP.NET, WinForms and others, resource management is pretty well thought of and documented. When I have xxx.hu.resx (a neutral culture) and the current culture is hu-HU (a specific culture), the fallback process will find xxx.hu.resx instead of xxx.hu-HU.resx.

In Sharepoint, there are so called provisioning resources in the Resources folder, pretty distinct from ASP.NET global resources. They are used by Sharepoint interally when displaying feature titles etc., and by SPUtility.GetLocalizedString. I failed to find specific documentation regarding my questions.

I have a hu-HU Sharepoint site collection and I deployed a dummy feature with a neutral (Resources.hu.resx) and an invariant culture (Resources.resx). Sharepoint simply wouldn't display the neutral resource, only the invariant one. When I added a specific culture (Resources.hu-HU.resx), it is displayed just fine. Looks like the specific-neutral fallback process is missing.

I also tried applying a NeutralResourcesLanguageAttribute to the solution assembly, tried every combination of the neutral culture, the fallback location and site collection language, and it simply didn't change a thing. Looks like this attribute is not supported at all.

Sadly I have no idea to find out by disassembly how it works because SPUtility.GetLocalizedString calls an unmanaged method.

Did I do something wrong, or did Sharepoint badly reinvent resource management and doesn't support the above stuff?

  • sorry but I read your question atleast 10 times, but am still confused whats the real problem – tereško Aug 29 '12 at 11:24

It's not well documented but SPUtility.GetLocalizedString don't support Language-neutral resources. See SharePoint SPUtility.GetLocalizedString() Behavior from Cliff Green's MSDN blog which describes SharePoints very different fallback behavior.

I don't know if SharePoint reinvented or invented the resource management, but as you can see it's using its own implementation.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.