# Chinese translation doesn't work

**URL:** <https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 11, 2024, 7:19am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672 "2024-06-11T07:19:17Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 11, 2024, 7:19am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/1 "2024-06-11T07:19:17Z")

</div>

Good morning,  
I'm working with the translation, I can translate to English but not to Chinese.

This is the dropdown for the language change

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/4/34331c259aa44a6ba7c05efbb8d80c032b80a4d0.png)

This is the text that I'm trying to translate:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/3/b303e9720152d20230b3a44cc9e3269caab8fecd.png)

The translation should work in a simple button, the English is translated properly but when I translate from English to Chinese, the strange thing is that the word is translated to Italian.  
It looks like the Chinese language is not supported..

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 11, 2024, 7:33am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/2 "2024-06-11T07:33:58Z")

</div>

Make sure you are wrapping your Chinese strings in `unicode()` or prefacing them with `u'`. Otherwise, they will not be rendered correctly.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 11, 2024, 7:37am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/3 "2024-06-11T07:37:29Z")

</div>

Hi Justin,  
you mean add the `u'` in the translation manager before the translation? For example `u'转移`? Because I try to do it and it's now working.

Anyway, what do you mean with wrapping in `unicode()`?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 11, 2024, 7:47am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/4 "2024-06-11T07:47:58Z")

</div>

Unicode is just another way of doing the same thing.  
**Example:** `unicode('转移')`

In Jython 2.7, `unicode()` is used to cast to a Unicode string as opposed to ASCII. In later versions of Python (starting from Python 3), all strings are Unicode by default, and `str()` can be used, but in Ignition Jython scripting, I've found that it's safer to perform string casts with `unicode()` instead of `str()` because otherwise, I run into issues with special characters.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 11, 2024, 8:48am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/5 "2024-06-11T08:48:30Z")

</div>

You need to apologize me, but how can I insert the unicode() function in the translation manager? Because I would like to avoid to add a script for every component in the view, it should be crazy.

And thanks for the explanation!

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 11, 2024, 8:54am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/6 "2024-06-11T08:54:40Z")

</div>

> [@Aiasa21](#):
>
> need to apologize

No need for an apology, I was just being thorough when I offered both ways I know of for handling unicode characters in Ignition. I'm glad this worked for you:

> [@justinedwards.jle](#):
>
> or prefacing them with `u'`

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 11, 2024, 8:57am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/7 "2024-06-11T08:57:43Z")

</div>

Actually I try both the method in the translation manager but I can't make them work.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/9/09a65a4efa2ea69b94bcf460ec4caab5778aa64c.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/f/2f4253debca820e18856c5e74f02327b5e3ae991.png)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 11, 2024, 9:20am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/9 "2024-06-11T09:20:19Z")

</div>

When I test this, it works for me, but the only thing I see that the translation manager doesn't like is that it sees the Chinese characters as lower case. You could try changing the ignore capitalization setting to see if it translates with that set to True:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/6/666e5721519dcacc929889cbc5e03d1eb0bdb69b.png)

**Edit:** I meant to say, it works for me without the need for any unicode handling.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 11, 2024, 9:25am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/10 "2024-06-11T09:25:44Z")

</div>

At the moment I have all the settings set to "Ignore".

Do you set `zh-CN` as language code?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 11, 2024, 9:28am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/11 "2024-06-11T09:28:03Z")

</div>

Yes. I used Chinese Simplified.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 11, 2024, 9:52am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/12 "2024-06-11T09:52:16Z")

</div>

Very strange I really don't understand where is the error.. Later I will make some more test with a simple label.  
Thanks again

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 11, 2024, 11:55am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/13 "2024-06-11T11:55:48Z")

</div>

Ok, I make it work in this way:  
language `Chinese Simplified`  
locale `zh-Hans`

I don't understand one thing.. I add this key:  
italian `Turno`  
english 'Shift'  
chinese '转移'

I have this label with the text: `Shift :` and in this case the translator manager looks like it can't associate the text with the colon.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/2/c2b3a4fba19a3febce0454d09f1785a3a00a18da.png)

How can I fix this? I wouldn't add both `Shift` and `Shift :` in the translation manager, it should be a huge amount of work.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 12, 2024, 12:15am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/15 "2024-06-12T00:15:07Z")

</div>

> [@Aiasa21](#):
>
> `Shift :`

That's the difference; I didn't realize that there was space between the word and the colon when I tested it, so I was using `Turno:` and `Shift:` instead of `Turno :` and `Shift :`. When I went back and retested it with the space, I got the same result that you are reporting.

---

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [June 12, 2024, 1:31am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/16 "2024-06-12T01:31:34Z")

</div>

Italian--English--Chinese，maybe you have to add English translation, then add Chinese translation, that will take effect.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 12, 2024, 6:53pm UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/17 "2024-06-12T18:53:17Z")

</div>

> [@justinedwards.jle](#):
>
> That's the difference; I didn't realize that there was space between the word and the colon when I tested it, so I was using `Turno:` and `Shift:` instead of `Turno :` and `Shift :`. When I went back and retested it with the space, I got the same result that you are reporting.

Ok, do you think is a bug? I mean in the "Settings" I set the option `Ignore Whitespace`, I guess this should be tehe case..

@taohongyu88, you mean use as primary language English and then choose Italian and Chinese as secondary?

---

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [June 13, 2024, 2:53am UTC](https://forum.inductiveautomation.com/t/chinese-translation-doesnt-work/91672/18 "2024-06-13T02:53:55Z")

</div>

Yeah! Must have English.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8b4473e936826b3e272a9d2289bfd54a35e1ac80.png)
