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?

1 Answer 1

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)

2
  • 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, 2019 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? Nov 13, 2019 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.