RCC Parse Error for adding qm file using QTranslate
-
I am trying to add localisation in my app and I have created all the resource files using mainly from this link "help": http://blog.qt.digia.com/blog/2014/03/19/qt-weekly-2-localizing-qt-quick-apps/. Everything looks fine as Qt Linguist can detect qsTr() in targeted qml file and can also generate respective qm file. but at build time it throws this error
@RCC Parse Error: '../city/translations.qrc' Line: 1 Column: 1 [Start tag expected.] make: *** [qrc_translations.cpp] Error 1@
this is major part from main.cpp
@ QTranslator cityTranslator; cityTranslator.load("translations/city_se.qm" + QLocale::system().name()); app.installTranslator(&cityTranslator); cityQuickView view; view.setResizeMode(QQuickView::SizeRootObjectToView); view.addImportPath(QStringLiteral("qml")); view.setMainFile(QStringLiteral("app/main.qml")); view.showExpanded();@
here is my city.pro file
@ QT += qml quick sql xml network opengl
android { QT += androidextras } ios { QT += macextras } include(src/src.pri) include(app/app.pri) app.source = app app.target = qml.source = src/cityQuick qml.target = qml DEPLOYMENTFOLDERS += app qml lupdate_only { SOURCES += src/cityQuick/Settings/*.qml \ src/cityQuick/Settings/*.qml } RESOURCES += translations.qrc TRANSLATIONS += city_se.ts qtcAddDeployment() android:ANDROID_PACKAGE_SOURCE_DIR = $$PWD/src/esAndroid@
translation.qrc
@<!DOCTYPE RCC><RCC version="1.0"> <qresource prefix= "/"> <file>translations/city_se.qm</file> </qresource> </RCC>@
Paths of needed files:
city_se.ts: "/"
translations.qrc: "/"
city_se.qm: "translations/"