I came up with a method for changing the right click menu (also know as context menu) labels on the fly. Technically you could take this code and change other properties of right click menu items but I'll leave that to your imagination!

Here's the code (should be executed from the Zimlet):

Code:
    var zimlet_manager = this.getZimletManager();
    var panel_items = zimlet_manager.getPanelZimlets();
    var action_menu = null;
    
    for (var item in panel_items)
    {
        var panel_item = panel_items[item];
        
        if (panel_item.toString().match(/com_xxx_xxx/i))
        {
            action_menu = panel_item.getPanelActionMenu();
        }
    }
    
    var item = action_menu.getItem(2);
    item.setText('New Label');
I'll just explain a few things about this code.

1. You'll notice we're looping through an array of panel items in the middle of this code. What we need to do is check each panel item to find out which one belongs to the Zimlet we're working with, which is where "panel_item.toString().match(/com_xxx_xxx/i)" comes in. You will need to replace the text com_xxx_xxx with your Zimlet name. So if you call your Zimlet Com_Company_TestZimlet, then you would change the text in this code to read "panel_item.toString().match(/com_company_testzimlet/i)". If you're not familiar with regular expressions, the "i" after the slash makes the match case insensitive.

2. Once we have our panel item, we need to identify the specific menu item we'd like to work with. The menu items are in an array, in the same order you visibly see them in the webmail interface. Furthermore, because it's an array, your first menu item would be item 0. So this sample code uses menu item 2 which is actually the third item in the list. Also, separators count as menu items, but you can't really do much with them.

Just a side-bar. There is an alternate method called getItemById() which takes a string ID. I would assume it matches the ID that you specify in your XML config file. I gave this method a quick test but no matter what string I gave it, it kept giving me menu item 0. I knew my menu item positions wouldn't ever change so I just gave up on this method and used the standard method.

3. Finally, we set the new label with "item.setText('New Label');". Now, doing all this work to hard code a label in here is silly - but you can obviously put anything in here that you want now (which the whole point of doing this). So maybe you want a right click menu option that says something to the effect of "[Display Name]'s Coupons", you would then do something like:

Code:
    var item = action_menu.getItem(2);
    var name = appCtxt.get(ZmSetting.DISPLAY_NAME);
    item.setText(name + "'s Coupons");
So that's all for now. Feel free to ask any questions. This was done Zimbra 5.0.5.