Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 60

Thread: label Text is not changing using Qt Linguist

  1. #21
    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

    any how but its working properly and fine except
    text even i had tried the simple example just for conversion of text
    even that is translating the language but the text which is in bold comes out in regular font
    rather than returns in bold font style...

    if you know then just tell me how to translate bold label's text to bold not to regular...

    and i already had read it from all examples of qt i had concludede that it will be done by only this way if you know the another way then tell with a simple example code....

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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

    Use "<b>" tags, just like the source for the translation does. You are really doing something strange. Did you use lupdate to create a translation file or did you create/modify it by hand?

  3. #23
    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

    thanks for your reply
    but i think you are not getting somthing even i had send you the whole example code for it
    bold text is entered by designer in dialog folder contained volumeActionDialog
    and it contained 3 buttons and 3 label's
    label's text i had entered by designer so lupdate itself entered its entry in .ts file and i ll just enter the translated text for label in the translation tags in .ts file

    the whole label's text is translated even bold text is translated but it comes out as font type normal but it should comes out as font type bold

    how it is possible ???
    if you want to see the .ts file then see in translation folder and with name UnicodeTest_en.ts and UnicodeTest_fr.ts

    Use "<b>" tags, just like the source for the translation does.
    as you said i had used it but still its not gives result to bold

  4. #24
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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

    I have opened your ts files in Linguist and I don't see any bolded texts in translations. Moreover Linguist marks some of the translations as incorrect and I can't blaim it... You can't just translate letters and numbers. If the source text contains html tags (like '<span style="font-weight: 600;">') you have to include them in the translation. Did you use Linguist to do the translation? If you press CTRL+B (it might be Special+B on Mac) the tool will copy the source text to the translation so that you can just replace the characters without touching rich text tags.

    By the way - your dialog doesn't have a layout. Everything will break if you start resizing the window.
    Last edited by wysota; 18th September 2007 at 13:59. Reason: Added some content

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

    but this whole source tags text comes in .ts file from VolumeActionDialog.ui of dialog folder it is not manually added i had just added it's translation tags text

    so according to you what i have to do
    can you please tell it in a code example
    Did you use lupdate to create a translation file or did you create/modify it by hand?
    lupdate is used for first to create ts file and after adding translation tags again i do lupdate to modify it....

    when i use <b></b> and then i do lupdate then these tags are removed from ts file

    and what about this
    By the way - your dialog doesn't have a layout. Everything will break if you start resizing the window.
    Last edited by thomasjoy; 18th September 2007 at 14:33.

  6. #26
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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

    Quote Originally Posted by thomasjoy View Post
    can you please tell it in a code example
    Example attached.

    and what about this
    What about it? Open the volume dialog (for example in Designer) and resize it, you'll see.
    Attached Files Attached Files

  7. #27
    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

    what is in your attachment it is downloading application.php
    like this

    not your's give tsexample.tar.gz

    how to access it....???
    Attached Files Attached Files

  8. #28
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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

    You must have downloaded it incorrectly. Your browser might be setup in a wrong way. Either try again or try another browser.

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

    i had tried it in safari ,mozilla ,internet explorer ..
    and what else i have to try to download it?????

    if u can directly paste it in mail then mail will not shown to me

    let me make it easy you just tell me why its not picking font-style:bold as the label's text in VolumeActionDialog are in bold
    even if you still not understand it
    then make a ui with label having text in bold which is enter by designer only.
    then translate it and then tell me how it should be done....

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

    hi wysota

    please write your's example code on reply page still i didn't get the another solution to bold show bold line to bold main work depends on this highlighting the words in bold so please do tell me if you know how to do..
    as you had give me the example code in zip but its not downloading the exact ...it is downloading something else...

    is there any other way if you know then also do tell....

  11. #31
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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

    The code contains such files as the Designer user interface file and Qt translation files. The code is quite long because of that (xml, you know...). I'd like to avoid pasting it here. I will temporarily place the archive under a following link:

    http://www.wysota.eu.org/old/x/tsexample.tar.gz

    I suggest you fix the problem with your browsers or you won't be able to download any attachment on this forum.

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

    thomasjoy (24th September 2007)

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

    thanks for yours support
    can you tell me which qt version you are using
    i am using QT4.1
    or is it affect to linguist??

    and had you entered the text by designer???

    are you getting difference from ur's and mine .ts file
    see attached ts file of mine
    Attached Files Attached Files
    Last edited by thomasjoy; 24th September 2007 at 11:51.

  14. #33
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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

    Quote Originally Posted by thomasjoy View Post
    can you tell me which qt version you are using
    i am using QT4.1
    Currently I'm using 4.3.0, but the behaviour of translation tools is the same since the very beginning of Qt4 (with one little exception).

    or is it affect to linguist??
    No, it shouldn't affect linguist.

    and had you entered the text by designer???
    Yes, I have. Source in Designer and translation in Linguist.

    are you getting difference from ur's and mine .ts file
    see attached ts file of mine
    From the very beginning I'm telling you your translation is incorrect. You are not using bold text in it. Take a look at the screenshot. Do you see that the source and translation are very different? The source contains formatting and the translation doesn't. That's why formatting is lost.
    Attached Images Attached Images

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

    thomasjoy (25th September 2007)

  16. #34
    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

    thanks wysota you are really a guru
    my major problem to bold the text is solved but
    one problem is still remaining as in my example i have 2 languages
    english and french
    as French translation in French is Frençais
    but my ts file made it Frenais here the special character ç is not showing why so its happening ???what is the reason??do tell me ...
    as one of the qt manual example is working on my system very well....that is i18n

    thanks in advance

  17. #35
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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

    Either the font you use doesn't have the glyph or the ts file is saved with a wrong encoding (should be UTF-8 I think). Did you use Linguist to create the translation?

  18. #36
    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

    Either the font you use doesn't have the glyph
    how it can be beacuse one of qt manual examples are running well so i beleive there is not problem with fonts...
    r the ts file is saved with a wrong encoding (should be UTF-8 I think).
    how it can be done in ts file
    as i add entered the line in ts file
    <?xml version="1.0" encoding="utf-8"?>
    but when again i do it lupdate to modify the file then it automatically deleted in ts file
    Did you use Linguist to create the translation?
    yes i am using linguist
    i am using lupdate for.ts file and lrelease for .qm files

    so tell me how it can be done????

  19. #37
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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

    Quote Originally Posted by thomasjoy View Post
    how it can be done in ts file
    as i add entered the line in ts file
    <?xml version="1.0" encoding="utf-8"?>
    This doesn't matter. It's just text. You might be saving the file using a completely different encoding regardless of what you put into the header.

    but when again i do it lupdate to modify the file then it automatically deleted in ts file
    I didn't understand this one... What deleted what?

    yes i am using linguist
    i am using lupdate for.ts file and lrelease for .qm files
    If you're not touching the files manually then you shouldn't have any problems. Could you post such example ts/qm files that don't work for you (make it simple please - a single message containing a single character that doesn't work)?

  20. #38
    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

    Could you post such example ts/qm files that don't work for you (make it simple please - a single message containing a single character that doesn't work)?

    see the attachment and see the translation tag for French
    showing Frenais rather tahn Frençais
    Attached Files Attached Files
    Last edited by thomasjoy; 25th September 2007 at 14:02.

  21. #39
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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

    The ts file contains the string 'franais' (and why is the message marked as unfinished? You should have confirmed the translation...).

    xml Code:
    1. <message>
    2. <source>French</source>
    3. <translation type="unfinished">Franais</translation>
    4. </message>
    To copy to clipboard, switch view to plain text mode 

    Are you really using Linguist to provide the translation? Maybe you should consider upgrading your Qt installation then...

    Here is how it should look like...
    Attached Files Attached Files

  22. #40
    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

    as i had given you my ts and qm
    you just use it in qt4.1
    may be it affects...
    see what i am doing

    qmake -project
    adding ts file in .pro with TRANSLATIONS+=

    lupdate unicodetest.pro (create unicodetest_en.ts and unicodetest_fr.ts)
    (and why is the message marked as unfinished?
    its automatically comes with lupdate

    then i manully add translation of French in translation tag (Frençais)

    then lupdate unicodetest.pro (when i open and see the ts file it shows Frenais)

    lrelease unicodetest.pro

    qmake &&make


    all these commands i am running

    now do tell what to do????
    Last edited by thomasjoy; 25th September 2007 at 14:59.

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.