Linguist problem



  • hi everybody. i cant use linguist please help me :

    i use visual studio 2008 and Qt 4.8.1 for vs. ok when i exec "lupdate emptyProject.pro" in cmd my output is :

    C:/Qt/4.8.1/src/corelib/tools/qbytearray.h:618: circular inclusion of C:/Qt/4.8.
    1/include/QtCore/qstring.h
    C:/Qt/4.8.1/src/corelib/tools/qstringbuilder.h:45: circular inclusion of C:/Qt/4
    .8.1/include/QtCore/qstring.h
    C:/Qt/4.8.1/src/gui/painting/qwmatrix.h:45: circular inclusion of C:/Qt/4.8.1/in
    clude/QtGui/qmatrix.h
    C:/Qt/4.8.1/src/gui/kernel/qactiongroup.h:45: circular inclusion of C:/Qt/4.8.1/
    include/QtGui/qaction.h
    C:/Qt/4.8.1/src/gui/kernel/qlayout.h:236: circular inclusion of C:/Qt/4.8.1/incl
    ude/QtGui/qboxlayout.h
    C:/Qt/4.8.1/src/gui/kernel/qgridlayout.h:45: circular inclusion of C:/Qt/4.8.1/i
    nclude/QtGui/qlayout.h
    Updating 'Documents/Qt Project/emptyProject/pr_la.ts'...
    Found 1 source text(s) (1 new and 0 already existing)

    after converting i exec "lrelease emptyProject.pro" and :

    The directory name is invalid.
    Could not find qmake configuration directoryCould not find qmake configuration f
    ileUsing OS scope before setting MAKEFILE_GENERATORUpdating 'C:/Users/Arman/Docu
    ments/Qt Project/emptyProject/pr_la.qm'...
    Generated 1 translation(s) (1 finished and 0 unfinished)

    and this is my code :
    @
    #include <QtGui>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QTranslator pr;
    pr.load( "pr_la" );
    
    app.installTranslator( &pr);
    
    QPushButton btn( QPushButton::tr("hello") );
    btn.show();
    
    return app.exec();
    

    }
    @

    but doesnt work when i exec my project. and "hello" work doesnt translation! tnx 4hlp



  • Please show contents of .pro file.

    Do you translate your file correctly? Please make sure that you didn't skip a step. You should open your .ts file with Qt linguist, translate it and save translation.

    Specify absoloute or relative path to your binary translation file. Normally, such files have .qm extention (unless you rename them) but in code you sent:

    @
    pr.load( "pr_la" );
    @

    You are loading a file with no extention in current working directory. I think it should be:
    @
    pr.load( "./pr_la.qm" );
    @
    Or better than previous:
    @
    pr.load( QString("%1/%2").arg(qApp->applicationDirPath()).arg("pr_la.qm"));
    @



  • my .pro file is :

    SOURCES +=
    main.cpp

    TRANSLATIONS = pr_la.ts



  • Looks good. There should not be any problem.



  • but i have problem ! it doesnt work !



  • Please describe more.



  • I have the same problem. VS 2008, Qt 4.8.0. Any ideas?



  • Please verify that your translation loads or not:
    @qDebug()<< translation.load(...);@



  • before i create this topic, i examine this and return true



  • i realy dont know whats my problem !!
    please check my output . its true ?!!

    "after converting i exec “lrelease emptyProject.pro” and :

    The directory name is invalid.
    Could not find qmake configuration directoryCould not find qmake configuration f
    ileUsing OS scope before setting MAKEFILE_GENERATORUpdating ‘C:/Users/Arman/Docu
    ments/Qt Project/emptyProject/pr_la.qm’… Generated 1 translation(s) (1 finished and 0 unfinished)"



  • Do you have a .qm file generated?



  • can you speak persian with me ? if not , yes its generate .qm file but i dont know its correct !



  • "Forums > International > Persian":http://qt-project.org/forums/viewforum/40/


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.