Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to support Chinese word with i18n file #289

Closed
zouyi100 opened this issue Dec 24, 2019 · 5 comments
Closed

How to support Chinese word with i18n file #289

zouyi100 opened this issue Dec 24, 2019 · 5 comments
Labels
help provided Consulting given or question answered module/ui5-cli Related to the UI5 CLI module

Comments

@zouyi100
Copy link

Expected Behavior

"你好" -> "你好"

Current Behavior

"你好" -> "ä½ å¥½ï¼�é�¹å��ç��"

Steps to reproduce the issue

  1. use i18n_zh.properties file
  2. use sap.ui.getCore().getConfiguration().setLanguage("zh"); to set language to chinese
  3. copy "你好" to i18n_zh.properties file as HELLO_WORD=你好
  4. add a <Text text="{i18n>HELLO_WORD}">
  5. and you will see the mass code.
  6. my i18n_zh.properties file is encoding with UTF-8
  7. I has changed it with GKB also ISO-8859-1 but not work well.

Context

  • UI5 Module Version (output of ui5 --version when using the CLI): 1.12.1
  • Node.js Version: v10.15.3
  • npm Version: 6.13.1
  • OS/Platform: Windows 10
  • Browser (if relevant): Chrome 79
  • Other information:

Here is a similar problem i18n.properties responds with wrong charset SAP/ui5-cli#196
But i don't think it has been fixed.

So, please help me to solve the problem. Thank you

@zouyi100
Copy link
Author

And I import my project into webide. The charset is correct.

@RandomByte
Copy link
Member

Hey @zouyi100,

In step 5, do you use the ui5 serve command or do you use ui5 build to build the app and test it using a different server?

@zouyi100
Copy link
Author

Hi, @RandomByte

In step 5, I used the ui5 serve -o index.html command.
And the Chinese words became mass code.

But when I use the 'go live' module in vscode. it works.

Also, I have run ui5 build and deploy the dist folder to SCP Cloud Foundry env, and it is also the mass code.

Thank you!

@RandomByte
Copy link
Member

Thanks. Have you already tried setting the propertiesFileSourceEncoding configuration in your ui5.yaml to UTF-8?

Documentation: https://sap.github.io/ui5-tooling/pages/Configuration/#encoding-of-properties-files

Example: https://github.com/SAP-samples/openui5-sample-app/blob/master/ui5.yaml

@zouyi100
Copy link
Author

It works, Thank you!

@RandomByte RandomByte transferred this issue from SAP/ui5-cli Nov 19, 2020
@RandomByte RandomByte added help provided Consulting given or question answered module/ui5-cli Related to the UI5 CLI module labels Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help provided Consulting given or question answered module/ui5-cli Related to the UI5 CLI module
Projects
None yet
Development

No branches or pull requests

2 participants