Skip to Content
author's profile photo Former Member
Former Member

OpenUI5 missing 'messagebundle_en_US.properties' file

I am using WAMP server for OpenUI5 development. I have tested my code in IE10, Google Chrome and Firefox. Google Chrome is giving me following error:

GET http://localhost/openui5-sdk-1.16.8-SNAPSHOT/resources/sap/ui/commons/messagebundle_en_US.properties 404 (Not Found)

Inside "resources\sap\ui\commons" when I add a new file of messagebundle_en.properties and rename it to messagebundle_en_US.properties, the error disappears. Is it a bug in OpenUI5 causing Google Chrome to behave like this?

demo.html

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<script src="resources/sap-ui-core.js"

id="sap-ui-bootstrap"

data-sap-ui-libs="sap.ui.commons"

data-sap-ui-theme="sap_goldreflection">

</script>

<!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->

<script>

sap.ui.localResources("ui5demo");

var view = sap.ui.view({id:"idDemoView1", viewName:"ui5demo.DemoView", type:sap.ui.core.mvc.ViewType.JS});

view.placeAt("content");

</script>

</head>

<body class="sapUiBody" role="application">

<div id="content"></div>

</body>

</html>

DemoView.view.js

sap.ui.jsview("ui5demo.DemoView", {

/** Specifies the Controller belonging to this View.

* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.

* @memberOf ui5demo.DemoView

*/

getControllerName : function() {

return "ui5demo.DemoView";

},

/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.

* Since the Controller is given to this method, its event handlers can be attached right away.

* @memberOf ui5demo.DemoView

*/

createContent : function(oController) {

//Create a panel instance

var oPanel = new sap.ui.commons.Panel({width: "400px"});

//Set the title of the panel

oPanel.setText("Contact Data");

//Create a matrix layout with 2 columns

var oMatrix = new sap.ui.commons.layout.MatrixLayout({

layoutFixed: true,

width: '100%',

columns: 2

});

oMatrix.setWidths('100px', '200px');

//Create a simple form within the layout

var oLabel = new sap.ui.commons.Label({text: 'Name'});

var oInput = new sap.ui.commons.TextField({value: 'M.Saad', width: '100%'});

oLabel.setLabelFor(oInput);

oMatrix.createRow(oLabel, oInput);

oLabel = new sap.ui.commons.Label({text: 'First Name'});

oInput = new sap.ui.commons.TextField({value: 'Siddiqui', width: '100%'});

oLabel.setLabelFor(oInput);

oMatrix.createRow(oLabel, oInput);

// create ProgressIndicator

var oProgressIndicator1 = new sap.ui.commons.ProgressIndicator("ProgInd1", {

width: "100%",

percentValue: 33,

displayValue: "33%"

});

//Add the form and ProgressIndicator to the panels content area

oPanel.addContent(oMatrix);

oPanel.addContent(oProgressIndicator1);

//Add some buttons to the panel header

oPanel.addButton(new sap.ui.commons.Button({text: 'Save'}));

oPanel.addButton(new sap.ui.commons.Button({text: 'Cancel'}));

//Attach the panel to the page

oPanel.placeAt("content");

}

});

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Feb 16, 2014 at 10:50 PM

    Hi,

    it's not a bug nor any unintended behavior:

    UI5 automatically detects the user's language/locale (from a variety of sources) and tries to load the most suitable translation resource files. For many users the locale is "en_US", but UI5 does not come with US-specific English translation, but only with standard English ("en" without "US"). Once the specific file is not found, the standard english is automatically requested. You probably see the next file requested is exactly this.

    If it is also not found, the "default language" (original language written by developers, no locale suffix) is loaded.

    So it's the perfectly intended automatic attempt to find the best available language.

    Of course the "404-not-found" requests are not the best possible thing, so you can also configure which languages are available:, using the "data-sap-ui-xx-supportedLanguages='...'" attribute in the bootstrap script tag (not sure since which version, might be new in 1.18 or even 1.20), giving a list of locales for which the translation files are present. Then UI5 does not have to try.

    The alternative solution is to create files with the most-used locales in your target environment.

    Your workaround to set language="en" disables the automatic language selection, so it might not be best for all environments...

    Regards

    Andreas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2014 at 07:53 PM

    Adding data-sap-ui-language="en" solved the problem for Google Chrome.

    Reference:

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 29 at 09:21 AM

    Hello Andreas Kunz

    While I have no problem with limiting the set of available languages or creating dummy-locales for all used languages, it seems that even the english locale is missing for some stock components.

    These error messages are very annoying when developing / debugging. Is there any way of getting rid of them without faking existence of those files in a proxy?

    Thanks,

    Oliver


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.