Getting and setting default language from source
Hi, I'm writing a program where the default language is English, additional languages ​​are loaded from qm files, eg Polish.
How can I back to native language (English) without loading file ? (en.qm)
English is default language in source code.
Regards
Re: Getting and setting default language from source
I suppose you install translators using QCoreApplication::installTranslator(). Removing all of them with QCoreApplication::removeTranslator() should disable translation.
Re: Getting and setting default language from source
Quote:
Originally Posted by
yeye_olive
I suppose you install translators using QCoreApplication::installTranslator(). Removing all of them with QCoreApplication::removeTranslator() should disable translation.
Thank you for your reply. QCoreApplication::removeTranslator() does not restore the old translation.
Any ideas ?
Re: Getting and setting default language from source
You should have a translation catalog also for English (it can contain untranslated strings, you don't have to rewrite all the messages as translations) and then you can install that catalog on the translator. Also remember that you have to trigger retranslation after adding or removing translators by setting all user-visible strings again passing them through tr().