Designer Menu surrounded with ¿ and?

Hi,
I am new to Ignition and Module development, and I have been trying to learn from SDK example. I tried the example from javadoc based on JMenuMerge, and it worked.
Now, I want my menu to be separated (not part of File->New), and I think I get really close to get it working - but strangely, my menu text is surrounded by ¿ and ?

I wonder if anyone knows why?
My code below (DesignerHook.java):

 @Override
    public MenuBarMerge getModuleMenu() {
	    MenuBarMerge mExampleMenuBar = new MenuBarMerge("scripting-function-build-1.0.0-SNAPSHOT");
	    
	    // create menu item
	    JMenuMerge mExampleMenu = new JMenuMerge("Example Menu");
	    
	    JMenuItem mSayHello = new JMenuItem("Say Hello");
	    mSayHello.addActionListener(new ActionListener() {
		      public void actionPerformed(ActionEvent ev) {
		    	  myTestAction();
		      }
		    });
	    
	    mExampleMenu.add(mSayHello);
	    
	    mExampleMenuBar.add(mExampleMenu);
	    
		return mExampleMenuBar;
    }

and here’s the result:

image

Thanks

ok - I guess I should close this question myself now, since I think I should use different approach.
Still unsure with ¿ and ? I got using getModuleMenu(), but I am happy with the solution in this topic to use DesignerContext passed in startup() method to get Frame and Menubar from it.

hope this can be useful for others. My menu shows correctly now.

The question marks indicate that Ignition was trying to use the text as a key in to a localization bundle and failed to find that string. Supply a localization bundle (one or more) for your module.

@pturmel, thanks for that. your note led me to this post, which looks similar to the issue I had.
I will try it in my code …

Fair warning: Ignition is notorious for not releasing bundles on module restart/replacement. If you think it should work, try a gateway service restart to be sure.

yep, the resource bundle fixed my ¿? issue.

added in startup:

BundleUtil.get().addBundle("MyMenuBundle", getClass(), "ExampleScripting");

and in getModuleMenu():

JMenuMerge myMenu= new JMenuMerge("MyMenuBundle.menu1.Label");

Thank you.

1 Like