我的申请无法正常运作
这是我的代码
Label {
// The label text is set using the qsTr() function to support translation.
// and Retranslate.onLanguageChanged will force the string to update
// if language change happens while the app is running.
text: qsTr("hello world") + Retranslate.onLanguageChanged
// The label text style.
textStyle.base: SystemDefaults.TextStyles.BigText
textStyle.color: Color.create("#085861")
}
和
void ApplicationUI::onSystemLanguageChanged() {
QCoreApplication::instance()->removeTranslator(mTranslator);
QString localeString = QLocale().name();
QString fileName = QString("FirstProject_%1").arg(localeString);
if (mTranslator->load(fileName, "app/native/qm")) {
QCoreApplication::instance()->installTranslator(mTranslator);
}
}
项目正常运作。
http://downloads.blackberry.com/upr/developers/downloads/sampleapps/cascades/hellocascades.zip
我认为我的源代码和链接项目的源代码完全相同。
但是我的项目,翻译方法不起作用....