PDA

View Full Version : some doubts about translation



franco.amato
20th October 2010, 22:37
Hi to all,
I'm following the documentation and trying to implement translation in my qt application.
I understood that I need to generate *qm files that will be used by the application to translate the strings that are wrapped by the tr() macro.
In my case in the source code all strings are written in english and I would give to the user the possibility to change the language from english->spanish and vice versa. So I added the following entries to my pro file:


TRANSLATION = ecpstudio_es.ts

Then I called
lupdate ECP_Studio.pro and it created the ts file.
Then I loaded the ecpstudio_es.ts from linguist and I translated every english entry in spanish. Then I called release and it generated the corresponding qm file. So now I should be able to change the language from english to spanish.
My doubt is how can I do the opposite? Once I changed the language to spanish how can I came back to english?

Regards

franco.amato
20th October 2010, 23:20
Not so many replies please :p

wysota
20th October 2010, 23:26
Remove the spanish translator and optionally install a translator with english "translations" (an empty qm file)

franco.amato
20th October 2010, 23:31
Remove the spanish translator and optionally install a translator with english "translations" (an empty qm file)

I didn't understand you sorry.
Can you be more clear?

Regards

wysota
20th October 2010, 23:32
QCoreApplication::removeTranslator()