1

I have a SAPUI5 application.

The translated text is shown incorrectly in a dialog, while the translation is shown correct in the launchpad. Please see the following picture:

enter image description here

While the translation file is loaded for German language, it does not show [ÖÄÜß] correctly in the dialog. However it does show ö correctly in the launchpad page.

How can I solve it?

Jasperan
  • 2,154
  • 1
  • 16
  • 40
MJBZA
  • 4,796
  • 8
  • 48
  • 97

1 Answers1

7

Try setting /resources/configuration/propertiesFileSourceEncoding to UTF-8 in the tooling configuration file (typically ui5.yaml).

  1. In ui5.yaml:

    resources:
      configuration:
        propertiesFileSourceEncoding: UTF-8
    
  2. And in package.json:

    "devDependencies": {
      "@ui5/cli": "<at least 1.7.0>",
      ...
    },
    
  3. Re-build and deploy the app again.


About propertiesFileSourceEncoding

This option specifies the source encoding of *.properties files of the project. Those files will be read in the given encoding and any non-ASCII characters replaced with the respective unicode escape sequences. (doc)

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
  • The setting is like this already. In the WEB IDE it shows all the string correct but when I deploy it, it shows the string in dialogs wrong. I changed the UTF-8 characters in my i18n files like this: `addressInfo=Oskar-J\u00E4ger-Stra\u00DFe 170, 50825 Cologne, Germany` and it solved my problem. – MJBZA Nov 13 '19 at 11:20
  • @MahdiJ.Ansari That is exactly what `propertiesFileSourceEncoding` is supposed to do: replacing non-ASCII chars like `öäüß` to encoded unicode-number (e.g. `\u00F6`) before building & deployment. Otherwise, app developers would have to replace all the non-ASCII chars one by one by themselves. I guess the reason why it didn't have any effect in your case was probably the lower `@ui5/cli` version as `propertiesFileSourceEncoding` is supported only as of `1.7.0`? – Boghyon Hoffmann Nov 13 '19 at 11:27