Rename menuitem Menubar Windows (bug?)

To give users the option to change the language of the program I have created a method In which based on the language a string array is filled by translated text and menu names etc.

Then I try to update the menubar names like this:
MenuBar_Hoofdscherm.Child(“MIinstellingen”).Child(“MBestandsnaam”).Text = sText(21)
MenuBar_Hoofdscherm.Child(“MIinstellingen”).Child(“MBestandsnaam”).Child(“MBnBankrekeningnr”).Text = sText(45)

Compiled as a MAC OSx application both the main menuitem “MBestandsnaam” as the submenu item “MBnBankrekeningnr” are renamed.

As a Windows app only the submenu item is renamed: “MBnBankrekeningnr”

Why is this not working for Windows Apps? Bug?

On http://www.monkeybreadsoftware.eu/listarchive-realbasic-nug/2004-06-08-19.shtml I found somebody with a identical problem (but no solution):

[i]Refreshing menu bar on Win32
Date: 08.06.04 14:26 (Tue, 8 Jun 2004 15:26:21 +0200)
From: Peter De Berdt
I’m in the process of writing in-app localization classes and on
MacOS everything works great: every control in the window is updated,
the menubar is updated, the menuitems are updated.

On Win32 everything works, except the menubar itself. For some
reason, even though the Text property of the Menubar items is set
correctly (I checked it in the debugger and the menubar item’s text
is changed), but it doesn’t show in the application itself.

Is there a declare I can use to force the menubar to refresh?[/i]

In the debugger all ‘text’ properties are correctly changed. But only the Submenu’s are show correctly. The text of the mainmenuitems don’t change.

As a correction of above: Only the main menu items and the final menuitems are correctly changed in a Windows App.

Xojo failes to change the red marked menu names. In the above case the language should be all German but parts stay Dutch now (initial text property in the menu)

Somebody a solution?

I cannot locate any mention of it at the moment, but I remember discussions where it appeared menuItems in Windows could not be changed as in Mac.

I have menus localized in English, French and Spanish in my apps, but I use dynamic constants, and do not change after the app has started.

You may try to use different menubars, one for each language.

Or create a brand new menubar in code before applying it.

Seems to work here
This is what I did

@Norman Palardy Thanks.

if you use MainMenuBar.Child(“test”).Child(“TestNederlands2”).Text = “English 2” It fails to change the text of the submenu. But if you substitute MainMenuBar.Child(“test”) directly with the mainmenu item ‘test’ it succeeds.

if i use test.Child(“TestNederlands2”).Text = “English 2” the translations succeeds. :slight_smile:

With the 2018.1 version of Xojo I have the same problem back again in Windows apps (MAC is working OK).

This worked perfectly in the versions of XOJO before 2018.1:

2017.3 version
screenshot 2017.3

but not in 2018.1 version:
screenshot 2018.1t

I also added a sample project:

sample project