21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 513 Views |
-
Translate SiteTree context menu??

2 February 2011 at 10:43pm
Hi all,
Has anyone found a proper way to translate the SiteTree context menu - the popup you get when right-clicking the CMS Sitetree?
It's the TreeContextMenu = {... } bit in the /cms/javascript/CMSMain_left.js. Using the ss.i18n._t( ... ) method is not an option, I hope someone has thought of some workaround besides hacking the code directly?
Thanks,
Martine -
Re: Translate SiteTree context menu??

4 March 2011 at 7:25am
For anyone who's still interested: it can't be done properly . The menutext is hardcoded into the CMSMain_left.js file (around line 665) - in the indexvalues of the TreeContextMenu array. These indexvalues are then used in the LeftAndMain.js createContextMenu() function to create the contextmenu's innerHTML...
So my suggestion would be:
- replace the readable text indexvalues by something more 'symbolic' in cms/javascript/CMSMain_left.js around line 665
- translate them in cms/javascript/LeftAndMain.js around line 825 using something like translatedMenuItemName = ss.i18n._t('CONTEXTMENU.' + menuItemName, menuItemName);
- provide proper translations in cms/javascript/lang/en_US.js ao
Cheers, Martine
(Now if only I remembered how to properly do a patchfile )
| 513 Views | ||
|
Page:
1
|
Go to Top |
