Issue with messagebundle.properties in SAP UI 5

Viewed 1039

I am fairly new to SAP UI 5 and am a little confused as to why I am not seeing the correct descriptive text for elements within the framework.

I am using the sap.m.TableSelectDialog in my application and have based my work on the example here:

https://sapui5.hana.ondemand.com/#/sample/sap.m.sample.TableSelectDialog/preview

In the example you can see the use of the cancel button named 'Cancel'

However in my application the cancel button's name is set to 'MSGBOX_CANCEL'

I understand that the exact description is set in the messagebundle.properties file in a format like:

MSGBOX_CANCEL=Cancel

Could anyone point me in the right direction as to why this is not working for me?

I also receive the following error in the console:

enter image description here

The file is present though.

Cheers, James

2 Answers

Your webserver must know a MIME type for *.properties files.
Otherwise those files will not be served and you see a 404 error.

Examples:

In IIS on Windows you have to open up IIS Manager, click on server name in the left pane, in the middle pane double click the icon "MIME Types", and add File name extension ".properties" with MIME type "text/plain".

In Apache you simply open the file /conf/mime.types, look for the line starting with "text/plain", and add "properties" to the end. The result should look similar to this:

text/plain txt text conf properties

Check you project.json or component.js for proper binding of the resource bundle for i18n files.

Related