SharePoint 2010 Ribbon dynamic item localisation
-
martes, 21 de agosto de 2012 16:08
Hi,
We are using PageComponents and javascript to dynamically construct and populate some flyouts with menu options.
Some of the menu options text need to be localised but the resource access strings (eg "$Resources:MyRibbon.Ribbon,TestItem") dont bring thru the localised text.
Is there anyway to do this?
Cheers
Jonathan
- Editado jonathan.mooney martes, 21 de agosto de 2012 16:08
Todas las respuestas
-
miércoles, 22 de agosto de 2012 21:14
Hi Jonathan,
Are you deploying your .resx files into SharePoint Resources mapped folder? If so, and you're referencing it from the Elements.xml file, you use the syntax, $Resources: ResourceFileNameWithoutExtension, ResourceName.
For more info, check out this topic: http://sharepoint.stackexchange.com/questions/13172/how-to-enable-localization-for-custom-action-on-ribbon
- Kemp Brown [MSFT]
-
jueves, 23 de agosto de 2012 8:21
Hi,
Yeah all the appropriate files are being deployed to the resources mapped folder, the ribbon XML is localised and works fine. The problem is when we come to create dynamic dropdowns using the xml generated in javascript and our page component the localisation strings dont work.
Cheers
Jonathan
-
miércoles, 10 de octubre de 2012 8:51
I've found the answer so I thought id post it up.
Using the resource file strings in the dynamic ribbon controls isnt possible by just specifying the strings as its all client side at that point.
To get round this issue I created a HTTPHandler which intercepted all the .js files and searched for the strings using regex and then used SharePoint SPUtility.GetLocalizedString to replace the resource strings.
Works a treat
- Marcado como respuesta jonathan.mooney miércoles, 10 de octubre de 2012 8:51

