Results 1 to 3 of 3

Thread: language translations with Qt5.2

  1. #1
    Join Date
    Aug 2014
    Posts
    22
    Thanks
    5
    Qt products
    Qt5

    Default language translations with Qt5.2

    Hi9 All,
    I am new to Qt and C++;
    Creating a basic program for language translation with Qt 5.2 creator. I am referring the Hellotr() program from Qt docs for this.
    To get the lupdate and lrelease i am using the tolls provided with Qt Creator IDE. "tools/external/Linguist/Update Translations" and "Release translations".
    I have doent hte suggested changes in .pro, .ts file. but at result no Latin words are shown, instead English words from the source file are only shown.
    (If i change translations in ts file other english word, those do not appear).

    Can anyone help me on this?

    Thanks in advance.



    the text in .ts file is here.
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE TS>
    <TS version="2.1">
    <context>
    <name>MainWindow</name>
    <message>
    <location filename="mainwindow.ui" line="13"/>
    <source>MainWindow</source>
    <translation type="unfinished"></translation>
    </message>
    </context>
    <context>
    <name>QPushButton</name>
    <message>
    <location filename="main.cpp" line="14"/>
    <source>Hello world!</source>
    <translation>Great deal!!!</translation>
    </message>
    </context>
    </TS>
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: language translations with Qt5.2

    The location of the executable is probably not the source code directory so the "HelloWorld_la.qm" file will not be found by QTranslator::load() with a relative path and no specified directory

  3. #3
    Join Date
    Aug 2014
    Posts
    22
    Thanks
    5
    Qt products
    Qt5

    Default Re: language translations with Qt5.2

    Hi Chris,
    Thanks for reply.
    Yes that was the problem. and now i am able to see the translations.

    Thanks,

Similar Threads

  1. QLineEdit translations
    By plopes21 in forum Qt Programming
    Replies: 2
    Last Post: 9th March 2013, 15:17
  2. Translations in Qt
    By QbelcorT in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2009, 01:44
  3. Translations Using Linguist
    By QbelcorT in forum Qt Tools
    Replies: 0
    Last Post: 26th March 2009, 15:23
  4. translations
    By anafor2004 in forum Newbie
    Replies: 5
    Last Post: 1st February 2008, 09:26
  5. Contributing translations
    By JaSP in forum General Discussion
    Replies: 2
    Last Post: 30th December 2007, 11:25

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.