It's hard to be specific, but I'm having problems setting up translation files for the plug-in I'm building. The plug-in works fine, but I also want to enable translation of the GUI.

I've tried to Google a lot, but any instructions I find are poor in details. It also seems some other plug-ins in the repo don't get translated either, so it may be a bigger problem?

I'm running Ubuntu and QGIS 2.10. Plug-in is generated from the Plugin Builder, and modified in a text editor. Ts files are built using the "makefile" and edited in the "i18n" folder. Ts/qm files get deployed correctly, but will not translate the GUI! The main python file have text to be translated on the format "self.tr('text to translate')", which calls the "QCoreApplication.translate" function so it seems to me it all should work...

I've tried locale settings in QGIS for a number of common languages as well with very mixed results. Not sure I'm alone with this problem.

Anybody know of a GOOD instruction to get translation of plug-ins to work?

2 Answers 2


This aspect of plugin development is indeed poorly documented. I have run into the same problem and already posted a few answers to related questions :

Hope this will help you.


In adddition to what already suggested: pay attention that in the main Python file of your plugin (usually "pluginname.py") the name and path of the *.qm file are reported correctly and coherently to what you have.

Below the code snip that usually you find in the python file (especially i f you started creating the plugin with PluginBuilder). Hope this helps.


    initialize locale
    locale = QSettings().value('locale/userLocale')[0:2]
    locale_path = os.path.join(

    if os.path.exists(locale_path):
        self.translator = QTranslator()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.