Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. RCC Parse Error for adding qm file using QTranslate

RCC Parse Error for adding qm file using QTranslate

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 0 Posters 3.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    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/"

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved