Hello,
I'm using Qt 5.0.1 for my project. Every source code is written in French, and I want to translate it in English. With the prior version of Qt (4.x), I used to translate my program with no problems. But now with Qt 5, sentences with accents are not translated anymore.
I know Qt5 expects the source code to be written with UTF-8. Then I upgraded to Qt5, I changed the encoding of my files to UTF-8. So every header and source file is in UTF-8. I read on the Internet that one should add CODECFORTR = UTF-8 in their .pro file. Whether I do it or not, I still have the same issue.
Here is a piece of source code:
And here is how I see it in Qt Linguist:
We can notice that
QAction *fSaveMass
= file
->addAction
(tr
("Enregistrer sous différentes teintes"));
QAction *fSaveMass = file->addAction(tr("Enregistrer sous différentes teintes"));
To copy to clipboard, switch view to plain text mode
has become in Qt Linguist
QAction *fSaveMass
= file
->addAction
(tr
("Enregistrer sous différentes teintes"));
QAction *fSaveMass = file->addAction(tr("Enregistrer sous différentes teintes"));
To copy to clipboard, switch view to plain text mode
which means that Qt Linguist opens it thinking it's a latin encoding, while it's utf-8. But on the left and bottom side of Qt Linguist, it got the source code right: it's written "différentes" with the right encoding :s.
I think that's why my sentences with accents are not translated (the rest works fine). Does someone have any idea?
Thank you very much!
Regards,
Sébastien.
Bookmarks