add:   toolbarItem.setAttribute("class","translate-tool-" + languagePairs[glocale][0]);   toolbarItem.setAttribute("oncommand","if (event.target==this)   translateFrom('en_" + languagePairs[glocale][0] + "');");    
context: function initMenus(){   var languagePair;      var contextItem = document.getElementById("translate-context");      var contextMenuPopupElement = document.createElement("menupopup");      var contextMenuItemLabel;   var contextMenuItemTooltiptext;   var contextMenuItemOncommand;      var contextMenuItemElement;      var toolbarItem = document.getElementById("translate-pg");   var toolbarMenuPopupElement = document.createElement("menupopup");     var toolbarMenuItemLabel;   var toolbarMenuItemTooltiptext;   var toolbarMenuItemOncommand ;   var toolbarMenuItemElement;   	 for(var i = 1; i < languagePairs[glocale].length ; i++)   {	    	languagePair = languagePairs[glocale][i] + "_" + languagePairs[glocale][0];    	    	//setup up context menu    	contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label");      contextMenuItemTooltiptext = 	gTranslateBundle.getString(languagePair + ".tooltip");    	contextMenuItemOncommand = "translateSelection('" + languagePair + "');";   		   		contextMenuItemElement = document.createElement("menuitem");    	    	contextMenuItemElement.setAttribute("label",contextMenuItemLabel);    	contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext);    	contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand);						contextMenuPopupElement.appendChild(contextMenuItemElement);						//setup toolbutton menu			toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label");      toolbarMenuItemTooltiptext = 	gTranslateBundle.getString(languagePair + ".tooltip");    	toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');";   		   		toolbarMenuItemElement = document.createElement("menuitem");   	    	toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel);    	toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext);    	toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand);    	 							toolbarMenuPopupElement.appendChild(toolbarMenuItemElement);			    	    }            contextItem.appendChild(contextMenuPopupElement);    toolbarItem.appendChild(toolbarMenuPopupElement);        }
meta: 9817	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9817/c22e2dec771bfc17175819f09099d8186e8af7b7/translate.js/buggy/branch/options/chrome/content/translate.js