When defining a custom action via the CAML schema definition, the UrlAction parameter specifies the "site or site collection relative URL of the page, for example, ~site/_layouts/sampleurl.aspx or ~sitecollection/_layouts/sampleurl.aspx." (taken from MSDN).
<UrlAction Url="$Resources:osrvcore,List_Pages_UrlName;/SomePage.aspx" />
The above references the "SomePage.aspx" in the Pages library (this example was taken from the linked MSDN page, based on a reader suggestion). The library url is localized and changes based on the language the web site was created. This would work in most situations... but seems to fall appart when the MUI support comes into play.
Let me explain: suppose that we have only two language LangA (original server language) and LangB (language pack installed later).
- We first create a new site collection with language A and a subsite with language A
- We activate the MUI support on the web site/site collection
- We define a custom action for the subsite (created with language A) that uses the aforementioned UrlAction.
- We switch to LangB in the MUI settings.
Now the url action will point to the path of the Pages folder localized in the LangB language. No need to say that this will break the link, I suppose...
EDIT - To further elaborate: SharePoint provides "two" conceptual ways to localize a resource (please forgive the semplification here):
- Based on the website language: each SPWeb instance provides indication of the language the site was created with.
- Based on the Thread CurrentUi culture: based on the MUI inner working, you can use the ui culture of the current thread -Thread.CurrentThread.CurrentUICulture- to support localization (this is again a semplification, but should serve to illustrate the problem).
When we write "
Url="$Resources:osrvcore,List_Pages_UrlName;/SomePage.aspx"" the resource gets localized in the second way (MUI-aware). I'm wondering if there is a way to force localization based on the original web site locale.