翻译不能正确显示非 ASCII 字符 [英] Translation does not show non-ASCII characters correctly

查看:44
本文介绍了翻译不能正确显示非 ASCII 字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SAPUI5 应用程序.翻译的文本在对话框中显示错误,而翻译在启动板中显示正确.请看下图:

当为德语加载翻译文件时,它没有在对话框中正确显示 [ÖÄÜß].但是它确实在启动板页面中正确显示了 ö.

我该如何解决?

解决方案

尝试在工具配置文件中将 /resources/configuration/propertiesFileSourceEncoding 设置为 UTF-8ui5.yaml).

  1. ui5.yaml中:

    资源:配置:属性文件源编码:UTF-8

  2. package.json 中:

    "devDependencies": {"@ui5/cli": "<至少 1.7.0>",...},

  3. 重新构建和部署应用.

<小时>

关于propertiesFileSourceEncoding

<块引用>

此选项指定项目的*.properties 文件的源编码.这些文件将以给定的编码读取,任何非 ASCII 字符将替换为相应的 unicode 转义序列.(文档)

I have a SAPUI5 application. The translated text is shown wrongly in a dialog, while the translation is shown correct in the launchpad. Please see the following picture:

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

How can I solve it?

解决方案

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)

这篇关于翻译不能正确显示非 ASCII 字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆