# HTML Wrap Text on Button Breaks when switching languages

**URL:** <https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 7, 2023, 4:50pm UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739 "2023-03-07T16:50:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madison\_Cannon](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Madison\_Cannon](https://forum.inductiveautomation.com/u/Madison_Cannon)\
**Post date:** [March 7, 2023, 4:50pm UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739/1 "2023-03-07T16:50:39Z")

</div>

In vision I currently have a number of side bar buttons that when changing languages needs the text to be wrapped. When I try to implement the following for example "Fault   
 Records". When I change languages, it no longer works, it stays in English and not the language I selected. What am I missing?

---

<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:** [March 8, 2023, 2:34am UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739/2 "2023-03-08T02:34:32Z")

</div>

This is an interesting problem. I was able to replicate this using `<HTML> <div align="center"> Test Button` with the following set up:

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

Here was the result when I switched to Spanish:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/967683d8a67e42a1bbd5db8477362607c23ce816.png)

I even tried explicitly using `<HTML> <div align="center"> Test Button` in the translation manager, but nevertheless got the same result

---

<div class="post-metadata">

**Author:** ![Madison\_Cannon](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Madison\_Cannon](https://forum.inductiveautomation.com/u/Madison_Cannon)\
**Post date:** [March 8, 2023, 3:01pm UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739/3 "2023-03-08T15:01:00Z")

</div>

what I'm using is the following and it may be that I'm a newbie at python/jthon.  
But it's still not working on my side.

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

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/54dab8b8bcfa44b9e5097e7d562bb1f39d2730ee.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/0/8091d33b5d42956643794bdfa09361d7a8cd482c.png)

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [March 8, 2023, 4:44pm UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739/4 "2023-03-08T16:44:31Z")

</div>

I don't know what you're doing wrong but it works for me...  
 ![MultilineTranslations](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/96ad0046f1e9df4178b3f44e19b94567f4a7c4b6.gif)

For the first button, I've set the text: `'<html><center>Button1<br>Second Line'`  
and for the Slovenian translation: `'<html><center>Gumb1<br>Druga vrsta'`

Vision (swing) supports only an old HTML4...

---

<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:** [March 9, 2023, 1:15am UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739/5 "2023-03-09T01:15:23Z")

</div>

> [@zxcslo](#):
>
> it works for me...

Interesting. I copied and pasted yours into my translation manager, and it worked. Looking at it, I noticed that there was whitespace in my original experiment, so I added it in, but it still worked.

I had all of the options unchecked, so it's possible that I had a capitolization error or a mismatched whitespace in my initial experiment, but I didn't save the experimental project, so it's impossible to verify now:

@Madison_Cannon Perhaps check and see if one of these settings corrects the problem?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/3/c36dc6931955b29993f2ab0c3b3f0dd5b0297141.png)

---

<div class="post-metadata">

**Author:** ![Madison\_Cannon](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Madison\_Cannon](https://forum.inductiveautomation.com/u/Madison_Cannon)\
**Post date:** [March 9, 2023, 1:43pm UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739/6 "2023-03-09T13:43:18Z")

</div>

Are you saying i need to write the html for each language?

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [March 9, 2023, 4:12pm UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739/7 "2023-03-09T16:12:23Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 9, 2023, 6:00pm UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739/8 "2023-03-09T18:00:37Z")

</div>

_Or_, do the HTML and translation via an expression, e.g. `"<html><center>" + translate("key")`

---

<div class="post-metadata">

**Author:** ![Madison\_Cannon](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Madison\_Cannon](https://forum.inductiveautomation.com/u/Madison_Cannon)\
**Post date:** [March 9, 2023, 7:14pm UTC](https://forum.inductiveautomation.com/t/html-wrap-text-on-button-breaks-when-switching-languages/70739/9 "2023-03-09T19:14:53Z")

</div>

thanks everyone. I finally got it to work.
