Skip to content

Commit 55a243c

Browse files
authored
fix: avoid 404s in step 9 during development (#170)
1 parent 28ab2e6 commit 55a243c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

steps/09/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ We navigate to the `webapp` folder and place the `Component.?s` file to it. This
4747

4848
We define the component by extending `sap/ui/core/UIComponent` and supplement the component with additional metadata. Within the `interfaces` settings, we specify that the component should implement the `sap/ui/core/IAsyncContentCreation` interface. This allows the component to be generated asynchronously, which in turn sets the component's rootView and router configuration to async.
4949

50-
When the component is instantiated, OpenUI5 automatically calls the `init` function of the component. It's obligatory to make the super call to the `init` function of the base class in the overridden `init` method. In this section, we also instantiate our data model and the `i18n` model, similar to what we did earlier in the `onInit` function of our app controller.
50+
When the component is instantiated, OpenUI5 automatically calls the `init` function of the component. It's obligatory to make the super call to the `init` function of the base class in the overridden `init` method. In this section, we also instantiate our data model and the `i18n` model, similar to what we did earlier in the `onInit` function of our app controller (*Hint: besides the `bundleName` we also specifiy the `supportedLocales` with an empty string as value in an array and an empty `fallbackLocale` to ensure that just the default `messagebundle.properties` is loaded without a language suffix to avoid 404s during development!*).
5151

5252
Finally we call the `createContent` hook method of the component. This method creates the content \(UI Control Tree\) of this component. Here, we create the view as we did in the `index.?s` file to set our app view as the root view of the component.
5353

@@ -79,7 +79,9 @@ export default class Component extends UIComponent {
7979

8080
// set i18n model
8181
const i18nModel = new ResourceModel({
82-
bundleName: "ui5.walkthrough.i18n.i18n"
82+
"bundleName": "ui5.walkthrough.i18n.i18n",
83+
"supportedLocales": [""],
84+
"fallbackLocale": ""
8385
});
8486
this.setModel(i18nModel, "i18n");
8587
};
@@ -115,7 +117,9 @@ sap.ui.define(["sap/ui/core/UIComponent", "sap/ui/core/mvc/XMLView", "sap/ui/mod
115117

116118
// set i18n model
117119
const i18nModel = new ResourceModel({
118-
bundleName: "ui5.walkthrough.i18n.i18n"
120+
"bundleName": "ui5.walkthrough.i18n.i18n",
121+
"supportedLocales": [""],
122+
"fallbackLocale": ""
119123
});
120124
this.setModel(i18nModel, "i18n");
121125
},

steps/09/webapp/Component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export default class Component extends UIComponent {
2525

2626
// set i18n model
2727
const i18nModel = new ResourceModel({
28-
bundleName: "ui5.walkthrough.i18n.i18n"
28+
"bundleName": "ui5.walkthrough.i18n.i18n",
29+
"supportedLocales": [""],
30+
"fallbackLocale": ""
2931
});
3032
this.setModel(i18nModel, "i18n");
3133
};

0 commit comments

Comments
 (0)