PDA

View Full Version : [ADDED] [V0.8] Ext.ux.TabCloseMenu i18n text



sipo
Apr 13, 2009, 10:40 AM
text: 'Close Tab'should be global
i want to set it to other language

geoffrey.mcgill
Apr 22, 2009, 3:56 AM
Hi sipo,

Thanks for the suggestion. I've added several new properties to the TabCloseMenu Plugin. The new properties include:

1. CloseTabText [Localizable] - "Text to display in ContextMenu for menu option to close current Tab."
2. CloseTabIcon - "The icon to use for the CloseTab menu item. See also, CloseTabIconCls to set an icon with a custom Css class."
3. CloseTabIconCls - "A CSS class that will provide a background image to be used as the icon to use for the CloseTab menu item (defaults to '')."

4. CloseOtherTabsText [Localizable] - "Text to display in ContextMenu for menu option to close other Tabs."
5. CloseOtherTabsIcon - "The icon to use for the CloseOtherTabs menu item. See also, CloseOtherTabsIconCls to set an icon with a custom Css class."
6. CloseOtherTabsIconCls - "A CSS class that will provide a background image to be used as the icon to use for the CloseOtherTabs menu item (defaults to '')."

The following code sample demonstrates the new properties.

Example


<ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Height="300">
<Tabs>
<ext:Tab ID="Tab1" runat="server" Title="Tab 1" Closable="true" />
<ext:Tab ID="Tab2" runat="server" Title="Tab 2" />
<ext:Tab ID="Tab4" runat="server" Title="Tab 3" Closable="true"/>
</Tabs>
<Plugins>
<ext:TabCloseMenu
runat="server"
CloseTabIcon="TabDelete"
CloseTabText="Close this Tab?"
CloseOtherTabsText="Close other Tabs?"
/>
</Plugins>
</ext:TabPanel>

There's also a special feature of the CloseTabText property where you can pass a placeholder "{0}" which will get replaced with the current Tabs .Title property. This allows for a per Tab customization of the context menu item .text property.

Example


CloseTabText="Close {0}"

With the TabPanel code sample above, if "Tab 3" is right-clicked, the context menu item will read "Close Tab 3".

This new code has been committed to SVN and will be publicly available with the v0.8 release.

Hope this helps.

geoffrey.mcgill
Apr 22, 2009, 3:58 AM
I forgot to point out, although it should be obvious in the above code sample... you can now set a .Icon for each of the context menu items.

Example


CloseTabIcon="TabDelete"