QT Linguist tool not picking up right translation
-
I am trying to use Translation feature in QT. There are more than 4000 translation needed to be done for one language. And I have to do this for more than 15 different languages. So, I decide to write language.ts files by shell scripts. After generating my language.ts succesfully, I open the file in notepad++ (in windows) and I can see the expected translation in the file. For example, in Brazilian language, following is the translation code is language.tsfile:-
<message> <location filename="temp_unit.ui" line="59"/> <source>Cancel</source> <translation>Отказ</translation> </message>
Now when I try open the file in QT Linguist tool, I got following error:-
Parse error at lang_Brazil.ts:1:38:Encountered incorrectly encoded content.
As details provided in this website, I replace encoding value utf-8 with ISO-8859-1 . Now I can open the file in QT Linguist but the translation is showing wrong characters, ex:- for Cancel it is showing Îòêàç (expected translation is Отказ).
Please confirm why it is not taking right translation in QT linguist while I can see it if I open language.ts file in notepad++
-
-
@TechieTab I would guess your script creates the ts files with another encoding than utf-8.
-
@Christian-Ehrlicher I just checked, It is ISO-8859-1. That's the format provided by file from which I am getting my translation. How to adjust QT accordingly? I am not sure of that
-
@TechieTab said in QT Linguist tool not picking up right translation:
How to adjust QT accordingly?
I don't know why you want to adjust Qt here. The ts-file needs to be UTF-8 so fix your script, Latin1 can not be used here - Отказ can not be displayed with the latin1-charset so I doubt you're using latin1 at all...