140
Views
4
Comments
Solved
[Multilingual Component] line breaks not showing in mobile
Question
multilingual-mobile-component
Reactive icon
Forge asset by OutSystems

Hi there,

If i have an "abc Text" element design time with line breaks, that shows in the mobile app. If i do a translation using the data-trans attribute of the element, and the translated text has line breaks in it, the line breaks don't show in the app. I tried with html tags, but that doesn't work.

So a translated text like this:

becomes like this with the Spanish text:

Please let me know how to get line breaks in translated text.

Saludos,

Wilko

2021-04-09 11-42-43
assif_tiger
 
MVP
Solution

Hi wilko odijk
You can refer the below approach :

for ex:

Replace(
GetTranslation("---KEY---","Your Line one text here {1}. Then this should appear on line two {1}. And now this will be appearing to the further next line"), 
"{1}", 
newLine()
)


So you actual string which you will give for translation will be 

"Your Line one text here {1}. Then this should appear on line two {1}. And now this will be appearing to the further next line"


I used the same approach for web & app, In  my case, I created a generic action which I use to create Dynamic Text using the placeholder pattern like {1}

Hope it helps,

Assif

UserImage.jpg
wilko odijk

hi assif,

so an "abc Text" element needs to be replaced with an expression in these situations, cause you can't replace in the"abc Text" element, right? 

saludos,

wilko

2021-04-09 11-42-43
assif_tiger
 
MVP

Hi wilko odijk,

yes absolutely, the dynamic text that we generate should be handle by expression & yes the same way I mentioned above.
Let me know if you need some help to manage.


Btw I use this plugin to manage the Mobile Translations & it's very handy.
https://www.outsystems.com/forge/component-overview/4667/mobile-translations

UserImage.jpg
wilko odijk

Assif hi,

with the expressions it works fine.

i changed the multilingual component myself:


with the backup and restore you can move translations between environments. with jason for all it creates on big json file for all modules. and in the module you can edit all languages at once. if i ever have the time, i might post this one also.

thanks for the help,

wilko

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.