[Qt-interest] Localization of plugins

R. Reucher rene.reucher at batcom-it.net
Mon Nov 2 12:53:19 CET 2009


On Mon, 02 Nov 2009 11:43:40 +0000, Anatoly Burakov wrote:
> I have a program that has multilingual interface. It loads *.qm files
> perfectly. However, i can't seem to find a way for a plugin loaded by a
> program to load its own *.qm file. Is there any way to do that at all?
I don't think there's a restriction of that sort in the plugin mechanism, 
however, when you load the plugin, you can also load the corresponding 
*.qm file _additionally_ -- using an additional QTranslator!

  QString lang = "de";
  ...
  myAppTranslator = new QTranslator(0);
  myAppTranslator->load("data/lang/myapp_") + lang + ".qm");
  qApp->installTranslator(myAppTranslator);
  ...
  myPluginTranslator = new QTranslator(0);
  myPluginTranslator->load("data/lang/plugin_") + lang + ".qm");
  qApp->installTranslator(myPluginTranslator);
  ...

HTH, René
-- 
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/



More information about the Qt-interest-old mailing list