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
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 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?

  2. #2
    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???

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 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.

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

    thomasjoy (13th September 2007)

  5. #4
    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

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 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

    Hard to say without seeing the file. But you didn't answer my questions.

  7. #6
    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 i am adding it manually in the translation file but even it is not changing the designer's UI
    i am translating whole application's text in .ts file and loading the .qm file in the code which i had shown you..so wht else you want to ask...

    as i had seen the XML file very keenly i think there is not a tag which is mismatching...
    i am attaching the .ts file see and tell where it is mismatching the tag

    see in the context name VolumeActionDialog and StellarPhoenixMAC
    Attached Files Attached Files
    Last edited by thomasjoy; 14th September 2007 at 08:42.

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 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

    But do you perform the retranslation anywhere? A string being in the translation file won't automagically translate itself when the language is changed. You need to wrap the string into tr() calls and make sure those calls are performed when the language is changed. Please take a simple form, uic it, look at the generated code and notice how Designer generated forms are being retranslated when the language changes.

  9. #8
    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

    may be i am not getting you what you want to say...
    but i wanna tell you what is my procedure means what i had done
    in my app i have one menu "language" containing two action English and French
    i was just doing to convert app to english and french
    when i click on english action everything in english when i click french firstly one message will appears in french that you had selected french language
    then i double click on the same window's body having treewidget's item when i double click on treewiget's item ,one another dialog appears which have some label text dialog's name is VolumeActionDialog and its class name is VolumeActionDlg(which is not changing the label text)


    see wht i am doing on terminal shell
    qmake -project
    adding lines for TRANLATIONS+=translation/StellarPhoenix_en.ts \
    translation/StellarPhoenix_fr.ts
    lupdate stellarphoenix.pro
    lrelease stellarphoenix.pro
    qmake -spec macx-g++
    qmake &&make

    what ever you are asking for retranslateUi() that is done in ui_VolumeActionDialog.h by qmake
    manually i am not doing retranslateUi() because label text i am adding by designer....

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 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 you attach the exact code of your application? We seem not to be getting anywhere right now...

  11. #10
    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

    ok leave it i'll find it later ..and do tell if you know how translate the text in bold i mean my label text is in bold
    and i want it should return , after translation , in bold
    see i have one paragraph having first line in bold and all others are normal how to ,after translation , i can show it in same format (first line in bold and rest all normal).

    thanks in advance

  12. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 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

    If you don't provide any code, we won't be able to help. You are doing something wrong, but we can't pinpoint it without your cooperation. If you don't want to show us the code, I can only redirect you to the docs:

  13. #12
    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

    not the problem is not in giving the code ....
    seee my problem is almost solved now everything is changing into another languages
    but one is not changing is label text which is in bold ....even label text is translated but not in bold in my text only the first line is in bold.....rest all is regular
    like this i have 3 labels ....

    and see the attachment with it
    Attached Files Attached Files

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
  •  
Qt is a trademark of The Qt Company.