Login  Register

Re: Plugin language strings / translation

Posted by Ilkos on Jul 25, 2013; 3:05am
URL: https://forum.librecad.org/Plugin-language-strings-translation-tp5708273p5708616.html

From Help:

void QCoreApplication::installTranslator ( QTranslator * translationFile ) [static]
Adds the translation file translationFile to the list of translation files to be used for translations.
Multiple translation files can be installed. Translations are searched for in the reverse order in which they were installed, so the most recently installed translation file is searched first and the first translation file installed is searched last. The search stops as soon as a translation containing a matching string is found.
Installing or removing a QTranslator, or changing an installed QTranslator generates a LanguageChange event for the QCoreApplication instance. A QApplication instance will propagate the event to all toplevel windows, where a reimplementation of changeEvent can re-translate the user interface by passing user-visible strings via the tr() function to the respective property setters. User-interface classes generated by Qt Designer provide a retranslateUi() function that can be called.