tags:

views:

68

answers:

3

Hi,

I'm working on supporting different languages for our GUI. I'm having a problem translating strings that have a '\n' in them. They seem to be ignored.

In Qt Designer I have a QCheckBox with this in the text field:

Here's an \nexample that doesn't work

This appears in english in our french translation.

Having looked at the .ts XML it seems that the text after the '\n' is ommited (I guess this is why it doesn't get translated ?)

Does anyone have a way of including a newline in the original text?


Seems I had carriage returns in my text before the newline. (no idea how they got there)

e.g

Here's an [][][][]\nexample that doesn't work

After removing them, the translation worked.

+1  A: 

Use the HTML subset: "Here's an <br />example that does work".

rpg
+2  A: 

The "\n" character itself was not my problem.

Some invisible carriage returns in the string was the culprit.

See http://qt.nokia.com/developer/task-tracker/index%5Fhtml?method=entry&amp;id=81275

Steven
A: 

I am translate the .ts (Qt linguist) files with TM-database software. It native support the .ts files, Translation memory and google translate. no problems with \n. TM-database is free and available at http://yehongmei.narod.ru/