Results 1 to 20 of 60

Thread: label Text is not changing using Qt Linguist

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2007
    Posts
    69
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Question label Text is not changing using Qt Linguist

    hi all
    i am using QT4.1 on Mac
    by using qt linguist i had made the whole application text into multi languages
    everything ia getting changed but text of label doesn't change
    when i do lupdate label text include much things like font-family,font:,font-weight etc.

    <source>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:Lucida Grande; font-size:13pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;create&lt;span style=&quot; font-weight:600;&quot;&gt; &lt;/span&gt;Image&lt;/p&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;It is used to create image file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
    <translation type="unfinished"></translation>

    but i had made it just as it is,as text of designer's label.like this

    <source>create Image
    It is used to create image file</source>
    <translation type="obsolete">crer image
    Elle est employe pour crer le dossier d image</translation>


    so do tell me why its not showing converted text

    if anyone ne know then do tell me what is the problem and also tell the reason to not converting


    thanks in advance

  2. #2
    Join Date
    Jan 2007
    Posts
    68
    Thanks
    9
    Thanked 8 Times in 8 Posts

    Default Re: label Text is not changing using Qt Linguist

    you should take a look @ the following example...

  3. The following user says thank you to darksaga for this useful post:

    thomasjoy (11th September 2007)

  4. #3
    Join Date
    Mar 2007
    Posts
    69
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Default Re: label Text is not changing using Qt Linguist

    but i am following exactly the same things as qt manual have the example
    and even i want to follw that way.....

    if you know then tell what problem can occur
    even on the same dialog text of buttons is changed title of windows is changing so why not the label text

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: label Text is not changing using Qt Linguist

    Could we see some code?

  6. #5
    Join Date
    Mar 2007
    Posts
    69
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Question Re: label Text is not changing using Qt Linguist

    actully problem is not with code
    as i had created the same kind of example that works fine
    but if project get larger or larger then it doesn't translate the label's text
    but it is showing message what ever i am going to show but label text which is placed on another dialog is not changing

    means by double clicking from mainwindow i get another dialog which have this label text

    so can you tell what problem it is ???


    thanks in advance

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: label Text is not changing using Qt Linguist

    Without any code we won't be able to help. The size of the application doesn't really matter. Maybe you forgot to update translation files or there is a problem with initializing the translator? Does QTranslator::load return true after loading the translation?

    Providing a minimal compilable example reproducing the problem would help greatly.

  8. #7
    Join Date
    Mar 2007
    Posts
    69
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Question Re: label Text is not changing using Qt Linguist

    thans for reply
    see firstly i had done the lupdate unicodetest.pro (to craete the .ts files)
    after inserting strings of label text in french language ,i.e UnicodeTest_fr.ts, i had done the
    lupdate unicodetest.pro
    lrelease unicodetest.pro
    and then qmake &&make on terminal
    and even translator is returning true but still label text is not changing on the another dialog

    see the code for french language



    void UnicodeTest :: OnClickFrench()
    {
    bool x=trans.load("UnicodeTest_fr","/UnicodeTest/translation");
    QString msgStr=trans.translate("UnicodeTest","You had chosen the French Language ");
    QMessageBox::information(0,"message",msgStr);
    QString menuActionStr= trans.translate("UnicodeTest","English");
    actionEnglish->setText(menuActionStr);
    QString menuActionStr1= trans.translate("UnicodeTest","French");
    actionFrench->setText(menuActionStr1);
    QString menuStr=trans.translate("UnicodeTest","Language");
    menuLanguage->setTitle(menuStr);
    qApp->installTranslator(&trans);

    }

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: label Text is not changing using Qt Linguist

    Do all the translate() calls return proper translated data? If so, then I don't see anything incorrect here... What exactly doesn't work? I'm only having a doubt about using translate() instead of tr() or QT_TR_NOOP() - are your strings even grabbed by lupdate into the ts file?

  10. #9
    Join Date
    Mar 2007
    Posts
    69
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Question Re: label Text is not changing using Qt Linguist

    yes every translate() is translating the text tha's why it shoeing the translated text on first window when i click french language on mainwindow but label text on next dialog which is written in one of my previous post...which is in< source>.....<translation > form is not changing....

    tell me what type of problems can be occured..with it???

  11. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: label Text is not changing using Qt Linguist

    Where do you perform the actual retranslation? For Designer created uis this will be done automatically through retranslateUi() method created by uic, but for manually coded windows you have to do that yourself.

  12. The following user says thank you to wysota for this useful post:

    thomasjoy (13th September 2007)

  13. #11
    Join Date
    Mar 2007
    Posts
    69
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Default Re: label Text is not changing using Qt Linguist

    can you tell me whe this error occurs???
    tag mismatch in XML file UnicodeTest_en.ts

    but as i had observed deeply there is no tag which is mismatching of XML file

    thanks in advance

Similar Threads

  1. Replies: 15
    Last Post: 31st January 2020, 18:25
  2. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  3. German text on the label in Linux
    By Krish_ng in forum Qt Programming
    Replies: 2
    Last Post: 13th July 2007, 22:20
  4. Replies: 1
    Last Post: 24th October 2006, 16:40
  5. Changing the text color of a QTreeView leaf.
    By johnny_sparx in forum Qt Programming
    Replies: 3
    Last Post: 22nd March 2006, 23:58

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.