Nominate our 2022 Qt Champions!

[Solved] Not all the text in my application is translated.

  • Hello Qt devs!

    As the title says, not all the text in my application is translated when running this code:

    QTranslator translator;

    Only parts of my application are translated. When looking in QLinguist, all sentences seems to be accepted - none are greyed out.

    Has anyone experienced this as well?

    Thank you for your time!

  • Which lines non-translated?
    Did you use tr() in your code?

  • As the previous poster said, only strings included in tr() will be translated! :-)

  • Yes I did use tr() on all strings.

  • Strange! Could you post one line of code which translated and one that did not?

  • In one line:

    @gpsUpdaterScreen = new ValueUpdater(tr("GPS coordinates"), tr("Get the GPS coordinates of the demo equipment."), myResources->getGpsObject(), tr("In order to affect the GPS position, please move around."));@

    The last string in that line is translated - the rest is not.

  • Can you post lupdate log?

    PS: I think the use of tr() in class constructor is bad idea...

  • Setting up a MinGW/Qt only environment...
    -- QTDIR set to C:\Qt\4.7.4
    -- PATH set to C:\Qt\4.7.4\bin
    -- Adding C:\MinGW\bin to PATH
    -- Adding C:\Windows\System32 to PATH
    -- QMAKESPEC set to win32-g++



    C:>cd Users\Mads\workspace\FlexTabDemo

    C:/Qt/4.7.4/mkspecs/features/default_post.prf(5):Function 'system' is not implem
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(66):Function 'eval' is not im
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(69):Function 'eval' is not im
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(72):Function 'eval' is not im
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(75):Function 'eval' is not im
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(78):Function 'eval' is not im
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(80):Function 'eval' is not im
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(82):Function 'eval' is not im
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(84):Function 'eval' is not im
    C:/Qt/4.7.4/src/corelib/tools/qstringbuilder.h:45: circular inclusion of c:/Qt/4
    C:/Qt/4.7.4/src/gui/painting/qwmatrix.h:45: circular inclusion of c:/Qt/4.7.4/in
    c:/Qt/4.7.4/include/QtGui/qaction.h:1: circular inclusion of C:/Qt/4.7.4/src/gui
    c:/Qt/4.7.4/include/QtGui/qboxlayout.h:1: circular inclusion of C:/Qt/4.7.4/src/
    C:/Qt/4.7.4/src/gui/kernel/qgridlayout.h:45: circular inclusion of c:/Qt/4.7.4/i
    Updating 'dan.ts'...
    Found 82 source text(s) (0 new and 82 already existing)
    Updating 'eng.ts'...
    Found 82 source text(s) (0 new and 82 already existing)
    Updating 'ger.ts'...
    Found 82 source text(s) (0 new and 82 already existing)


  • [quote author="RazrFalcon" date="1321371681"]PS: I think the use of tr() in class constructor is bad idea...[/quote]
    Could you explain why you think so?
    I don't see anything wrong with doing that in this way, but I may be overlooking something.

  • I agree with Andre. :-)

  • Andre, it's only my suggestion. I'm not sure about this. :-)

  • Okay I'm a bit embarrassed...

    When I first were introduced to Qt Linguist (last week) - a colleague showed me how to use it. It seemed quite simple. And it is, really! You just have to do ALL steps. :)

    I forgot to run "lrelease"...

    I'm sorry for the inconvenience.

    Thank you for your time!

  • Ah, ok. Thanks for reporting back!

  • I get the same problem but I can't find the solution ?
    please tell me how you resolved it ?
    the ts file doesn't generated absolutely


    Project MESSAGE:
    C:/Qt/4.7.4/mkspecs/features/default_post.prf(5):Function 'system' is not implemented
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(66):Function 'eval' is not implemented
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(69):Function 'eval' is not implemented
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(72):Function 'eval' is not implemented
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(75):Function 'eval' is not implemented
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(78):Function 'eval' is not implemented
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(80):Function 'eval' is not implemented
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(82):Function 'eval' is not implemented
    C:/Qt/4.7.4/mkspecs/features/debug_and_release.prf(84):Function 'eval' is not implemented

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.

Log in to reply