And that is it! You will now have a Switch Application Language option in the Help menu.

However the user will need to restart the application for the changes to take effect.

Dynamically changing the GUI

One step better is to change the language on the fly, as soon as the user has selected a new language.

This can seem a fairly daunting task, as a typical program can contain many hundreds of translatable strings that will need to be retranslated, but fortunately a lot of the work is already done for, and just needs to be connected together.

When the language of an application is changed, a LanguageChanged QEvent is sent to every single widget. The idea is that in the top level window you will listen for this event, tell the GUI to retranslate, tell the toolbars to retranslate, and then let any custom widgets clean up themselves.

So in your class that inherits from KXmlGuiWindow, add to the header file: