[Qt-interest] Qt localization: loading the localizaed string probelm
Ramesh
ramesh.bs at robosoftin.com
Tue Aug 10 09:08:51 CEST 2010
Hi,
i want to load the localized string in Qt application. for this i am
following few steps, correct me if i am wrong.
Note: it works fine for QString but not for const char*
1)update the pro file with translation language
2)generate .ts & edit using Qt linguist. Generate .qm file using lupdate and
lrelease.
3)load the .qm file from particular location.
here is how my const char* looks.
const char* sayHellow = QT_TRANSLATE_NOOP("FriendlyConversation","hellow");
LocalizationWithQT::LocalizationWithQT(QWidget *parent)
: QMainWindow(parent)
{
//ui.setupUi(this);
QString str = tr("say hellow");
QPushButton *pushbutton = new QPushButton(tr(sayHellow));
setCentralWidget(pushbutton);
}
here how i am loading the .qm file
QApplication a(argc, argv);
QTranslator translator;
bool val = translator.load("c:\\Data\\test\\hellotr_la");
a.installTranslator(&translator);
LocalizationWithQT w;
w.showMaximized();
return a.exec();
the problem is, if i provide any alternate Latin string to "sayhellow" its
not loading at all.. i don't nowhere is the mistake.. please suggest me the
solution..
Thanks in advance
-----------------------------------------------
Robosoft Technologies - Come home to Technology
Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100810/9f963c59/attachment.html
More information about the Qt-interest-old
mailing list