openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Walkthrough step 8: Translatable Texts, invalid ResouceModel instatiation

Open adsworth opened this issue 5 years ago • 4 comments

OpenUI5 version: current version from https://sapui5.hana.ondemand.com/resources/sap-ui-core.js

Steps to reproduce the problem: Follow the instruction from this page https://openui5.hana.ondemand.com/topic/df86bfbeab0645e5b764ffa488ed57dc

If the ResourceModel is instantiated as shown in the docs then openui5 will not try to load translations according to the browsers locale.

var i18nModel = new ResourceModel({
            bundleName: "sap.ui.demo.walkthrough.i18n.i18n",
            supportedLocales: [""],
            fallbackLocale: ""
         });

You actually have to either, set supportedLocales to the supported locales and fallbackLocale to your default locale, in which case you don't need the i18n.properties. Or remove the parameters to get the behavior described in the paragraph before the code sample.

At least that has been my findings after stumbling over that and trying a few different combinations.

adsworth avatar Feb 17 '21 22:02 adsworth

Hello adsworth,

thank you for submitting this issue. I have forwarded your issue to the responsible development team. They will contact you directly for further processing. Please refer to the internal incident 2180121430 for further questions.

Regards Sebastian

HerzogIgzorn avatar Feb 22 '21 09:02 HerzogIgzorn

Hello @adsworth , I fixed the issue with OpenUI5 1.88

KlattG avatar Feb 24 '21 13:02 KlattG

Hi @KlattG ,

thanks. Did you by chance have a look at the rest of the Walkthrough. There are a few other places that uses the ResourceModel in the same way. I found them after submitting this ticket and forgot to update it.

adsworth avatar Feb 25 '21 08:02 adsworth

Hi @adsworth , thanks for letting us know. We had another look at the Walkthrough and adapted some sample code / text in the two subsequent steps as well.

KlattG avatar Feb 26 '21 13:02 KlattG