Use of \n in labels works ok in the designer but not if modified

I have labels text that span several lines.
I used \n to tell AI2 to go to the new line and it works fine.
"3, 4, 10 choses ont été dites,\n mais dans quel ordre?"
Now I am localizing it using various languages and I found that the texts taken from an outside file do not identify \n as an LF.
Is there some way to make it work so that I can have my lines aligned in column?


1 Like

instead of \n use this <br>

Also see this might help :

1 Like

What does "taken from an outside file" mean?
To use <br> you have to set HTMLFormat (Designer - Label - Properties):


If you want to see the lines in an aligned column, the only way really is to use a List - either ListView or ListPicker. It's also the easiest by far.

Thank you all.
Actually the HTML format tick works both ways, i.e. when I put
in the designer label text and when I assign this text in the blocks.
But I don't understand why the \n works when I don't chek the HTML format and I put this \n in the designer label text, but it does not work when I assign this text in the program.
Actually, the exact situation is when the text comes from a text file that I upload among the resources.
It looks like AI2 does not recognize \n as an escape character but as a text.
That maybe related to the fact that the file embed this text under double quotes.

In my case I need the double quotes because AI2 recognizes fields in csv files only when they are separated by commas, while the text field itself has commas in it.
So the question then should be 'is there a way to change the csv file separator'?

1 Like

Hmmm, I put that text into a label and the line returns work OK


"LabMaisApres","Oui, mais apres? \nun recoit, qui donne?\nun donne, qui recoit?"


How are you feeding the text to a label?

I edited the message with a few lines to explain that the texts were coming from a csv file.

Can you provide an example csv file ?

here it is.
When I use \n instead of
it is recognized as a real text

Localization_pirke_avot_labels.csv (1.4 KB)

interesting to see that "<br>" was automatically translated to a LF in my response

All seems to be working OK here:

yes because in the file I sent you I used <br>
did you change them to \n?

no I used the
and htmlFormat.

Do you specifically need to use \n ?

No, now that I know of the <br> marker.
But it was strange to have this \n work in the designer and not from the file.

If I remember correctly, the \n will work in the purple text block as a line return, but not when you supply text from another source. You can't get text into a purple text block other than typing it in during development. Of interest, the line returns (non visible) in the csv file do not get actioned either in a label.

You could always keep your \n in your file, and then do a text replacement in the blocks, converting to <br>

Is there a place where I can find all the HTML tags that are allowed?
Actually since I am translatiing some label texts in hebrew I need the text to be aligned to the right.
There is no block to allow the right justifying the label text and I tested a variety of HTML tags but none worked.
I specifically tried some kind of inline CSS but to no avail.
example : <style>h2 {text-align: right;}</style>
then <h2>this is my label text <h2>

You can set Label Text as right-justify in the Designer Palette, but there is currently no support for right-to-left languages. There is a hack - include the right-to-left unicode marker in the text - I have never tried it.

#x200f  (U+200F)
or &rlm within HTML text

They are listed here:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.