Dear all,
I have three properties files located at “Interface/Properties/”:
menu.properties
menu_en.properties
menu_fr.properties
When I add the following code to my nifty xml file
[java]<resourceBundle id=“menu” filename=“Interface/Properties/menu” />[/java]
An error is occurred:
[java]java.lang.RuntimeException: java.util.MissingResourceException: Can’t find bundle for base name Interface/Properties/menu, locale fr[/java]
Can someone tell me why ???
Thank a lot !
Just tried on my own project and it works without errors , could you provide some simple code that reproduce this issue ?
. As I can see it should work…
Here is my code to initialize the Nifty object :
[java]private Nifty nifty;
@Override
public void initState(AppStateManager stateManager, Application app) {
// Init menu
guiViewPort = this.app.getGuiViewPort();
flyCam = this.app.getFlyByCamera();
NiftyJmeDisplay niftyDisplay =
new NiftyJmeDisplay(app.getAssetManager(),
app.getInputManager(),
app.getAudioRenderer(),
app.getViewPort());
nifty = niftyDisplay.getNifty();
nifty.setLocale(Locale.FRENCH);
nifty.fromXml("Interface/Menus/screen.xml", "index",
new MenuGUIController(this.app, settings, nifty));
guiViewPort.addProcessor(niftyDisplay);
flyCam.setEnabled(false);
}[/java]
And this is the Nifty XML:
[java]<?xml version=“1.0” encoding=“UTF-8” standalone=“no”?>
<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd”>
<useStyles filename="nifty-default-styles.xml" />
<useControls filename="nifty-default-controls.xml" />
<resourceBundle id="menu" filename="Interface/Properties/menu" />
<screen id="index" controller="mygame.guicontroller.MenuGUIController">
<!-- Background image -->
<layer id="background" childLayout="center">
<image filename="Interface/Menus/IndexNifty-small.jpg"></image>
</layer>
</screen>
</nifty>[/java]
And the asset:

Thank you in advance
your Properties folder is not under Interface folder , the right path to the bundle is : Properties/menu , so change the register bundle tag in :
[xml]
<resourceBundle id=”menu” filename=”Properties/menu” />
[/xml]
, I hope it works now 
1 Like
@relucri said:
your Properties folder is not under Interface folder , the right path to the bundle is : Properties/menu , so change the register bundle tag in :
[xml]
<resourceBundle id=”menu” filename=”Properties/menu” />
[/xml]
, I hope it works now 
Yes ! This is it… I’m feeling dummy now :facepalm: I don’t know why I didn’t see that simple error…
Thank a lot !
your welcome!
ihih don’t worry it happens! 