Changing menu labels (not menu items)

Hello,
I'm currently internationalizing a GUI written in wxPython (and PythonCard).

I have had no problem changing the labels of my menu items, but the
menu labels them selves I have been unable to change.

For example, I have a Menu "File", with menu item "Exit"
I was able to change the label of the exit item with the following code.

id = self.menuBar.getMenuId('menuFileExit')
mbar = self.GetMenuBar()
mbar.SetLabel(id, language.exitMenu)

where 'menuFileExit' was the name of the item, and 'language.exitMenu'
is the string that I want to set the label to.

But I have been un-able to find a way to change the "File" label (or
any other menu labels).
Any help would be very much appreciated.

Thank you.
Patrick Smith

Oops!
Sorry, ignore this, SetLabelTop, I somehow missed that during my many
passes through the doc.

···

On Thu, 28 Oct 2004 15:19:29 -0400, Pat Smith <smith.patrick@gmail.com> wrote:

Hello,
I'm currently internationalizing a GUI written in wxPython (and PythonCard).

I have had no problem changing the labels of my menu items, but the
menu labels them selves I have been unable to change.

For example, I have a Menu "File", with menu item "Exit"
I was able to change the label of the exit item with the following code.

id = self.menuBar.getMenuId('menuFileExit')
mbar = self.GetMenuBar()
mbar.SetLabel(id, language.exitMenu)

where 'menuFileExit' was the name of the item, and 'language.exitMenu'
is the string that I want to set the label to.

But I have been un-able to find a way to change the "File" label (or
any other menu labels).
Any help would be very much appreciated.

Thank you.
Patrick Smith

Hi Pat,

I see you found it, but looking at your code I wonder if you are aware of gettext?

I18n with gettext code:

Menu:
self.MainMenu.SetLabelTop(fileMenu, _('&File'))
Notebook:
self.wineDetailsNB.SetPageText(0, _('Welcome'))

The _() will do the translation for you, not quit alone, but you can find out more about it on these wiki pages:

http://wiki.wxpython.org/index.cgi/Internationalization
http://wiki.wxpython.org/index.cgi/RecipesI18n

See you
Werner

Pat Smith wrote:

···

Oops!
Sorry, ignore this, SetLabelTop, I somehow missed that during my many
passes through the doc.

On Thu, 28 Oct 2004 15:19:29 -0400, Pat Smith <smith.patrick@gmail.com> wrote:

Hello,
I'm currently internationalizing a GUI written in wxPython (and PythonCard).

I have had no problem changing the labels of my menu items, but the
menu labels them selves I have been unable to change.

For example, I have a Menu "File", with menu item "Exit"
I was able to change the label of the exit item with the following code.

id = self.menuBar.getMenuId('menuFileExit')
mbar = self.GetMenuBar()
mbar.SetLabel(id, language.exitMenu)

where 'menuFileExit' was the name of the item, and 'language.exitMenu'
is the string that I want to set the label to.

But I have been un-able to find a way to change the "File" label (or
any other menu labels).
Any help would be very much appreciated.

Thank you.
Patrick Smith

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org