Results 1 to 3 of 3

Thread: Qt Linguist and coding sources

  1. #1
    Join Date
    Oct 2010
    Location
    Poland
    Posts
    26
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Qt Linguist and coding sources

    I have source files with UTF-8 coding.

    In .pro file I add
    Qt Code:
    1. CODECFORTR = UTF-8
    2. CODECFORSRC = UTF-8
    To copy to clipboard, switch view to plain text mode 

    In main.cpp I add
    Qt Code:
    1. QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
    2. QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
    To copy to clipboard, switch view to plain text mode 

    And when I made lupdate then in Qt Linguist I have a good coding for words from .ui file and wrong from words which are from .cpp files.

    How to resolve this?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Qt Linguist and coding sources

    And you are sure, the cpp files are really encoded in UTF8? Also try trUtf8() to see if the text gets extracted right.

  3. #3
    Join Date
    Oct 2010
    Location
    Poland
    Posts
    26
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Linguist and coding sources

    I resolve problem. I made mistake - in my system I have lupdate - which is from Qt3 and lupdate-qt4, so I used a wrong lupdate. Sorry for this.

    But now I have wrong coding in window Sources and Forms when a source is display(I don't known a right name in eng because I have polish interface).
    Last edited by Hostel; 1st November 2010 at 02:54. Reason: updated contents

Similar Threads

  1. QT linguist Cmake
    By _Jack_ in forum Qt Programming
    Replies: 1
    Last Post: 18th September 2010, 12:29
  2. Replies: 0
    Last Post: 18th July 2009, 14:07
  3. Translations Using Linguist
    By QbelcorT in forum Qt Tools
    Replies: 0
    Last Post: 26th March 2009, 16:23
  4. How to use Qt Linguist
    By mourad in forum Qt Tools
    Replies: 1
    Last Post: 24th May 2008, 03:18
  5. Linguist and static strings
    By Equilibrium in forum Qt Tools
    Replies: 7
    Last Post: 5th March 2008, 14:08

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.