[Qgis-developer] plugin translation
matteo
matteo.ghetta at gmail.com
Tue Mar 22 02:27:28 PDT 2016
Hi Richard (and all),
I'm still fighting with the menu translation of the plugin..
I read the Qt Documentation and other related questions in forums, but
I'm still struggling.
It seems that, as you said, the tr function should do the magic, but it
won't..
I found out that with the main menu the method
QCoreApplication.translate is used while with the submenus nothing is
used.. for example:
#main menu
self.menu.ModelSetUp_menu =
QMenu(QCoreApplication.translate("my_plugin", "Model Setup"))
#submenu of menu "model Setup"
self.actionProgramLocations = QAction( "&Program &Locations",
self.iface.mainWindow())
I tried to add the tr function in both, like
self.menu.ModelSetUp_menu = QMenu(self.tr("my_plugin", "Model Setup"))
#submenu of menu "model Setup"
self.actionProgramLocations = QAction( self.tr("&Program &Locations"),
self.iface.mainWindow())
and then updated pro file.. but in the final ts, these strings are not
taken into account..
I also tried to find other plugins that maybe have implemented this menu
translation function, but I did not find anything (just the UIs and
their strings translated, but not the menus)...
Somebody has an idea on how to implement that?
Thanks for the help
Cheers
Matteo
More information about the Qgis-developer
mailing list