Results 1 to 6 of 6

Thread: is importing of .po files with contexts supported ?

  1. #1
    Join Date
    Jun 2012
    Posts
    63
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default is importing of .po files with contexts supported ?

    It looks like Qt Linquist does not support importing .po files with contexts. Can someone confirm this ?

    I have .po files with contexts. And when loading that file in Qt Linquist it shows this.


  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: is importing of .po files with contexts supported ?

    Have you tried lconvert as decribed here? http://qt-project.org/wiki/Qt-Localization
    Or maybe the po2ts tools from http://docs.translatehouse.org/proje...t/installation

    Cheers,
    _

  3. #3
    Join Date
    Jun 2012
    Posts
    63
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: is importing of .po files with contexts supported ?

    Thanks, I downloaded official qt localization files (.ts) and converted it into .po file. Some observations:

    It looks like two things are needed in the .po file for Qt Linquist to understand them:

    1) "X-Qt-Contexts: true\n"

    2) '|' character in context name. e.g. : msgctxt "short|"

    Next test is to create a .qm file and load actua translation file in the program.

  4. #4
    Join Date
    Jun 2012
    Posts
    63
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: is importing of .po files with contexts supported ?

    Is is possible programmatically to read a .po or .ts file and generate .qm files ? Basically I'm looking for a Qt class that might know how to do that. That must be already present in Qt Linquist application itself but do such class(es) exists within Qt classes that you could include in your Qt project ?

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: is importing of .po files with contexts supported ?

    Quote Originally Posted by phenoboy View Post
    Is is possible programmatically to read a .po or .ts file and generate .qm files ?
    Well, obvious, lrelease does that. And since it is a program, it is doing that process programmatically.

    Quote Originally Posted by phenoboy View Post
    Basically I'm looking for a Qt class that might know how to do that.
    Then a rather straight forward approach would be to check the program already known to contain that, no?

    Cheers,
    _

  6. #6
    Join Date
    Jun 2012
    Posts
    63
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: is importing of .po files with contexts supported ?

    Thanks, I'll check Qt Linquist source code but just using lrelease.exe might be enough.

Similar Threads

  1. Replies: 2
    Last Post: 20th July 2013, 18:00
  2. Replies: 1
    Last Post: 31st March 2011, 18:52
  3. Strategy for offscreen and onscreen gl contexts
    By mckinnon in forum Qt Programming
    Replies: 0
    Last Post: 22nd December 2010, 02:01
  4. qrc-files: which binary formats are supported?
    By freeman_w in forum Qt Programming
    Replies: 5
    Last Post: 3rd September 2009, 16:31
  5. QGLWidget, QPainter and shared contexts
    By bamboo in forum Qt Programming
    Replies: 7
    Last Post: 17th April 2007, 18:11

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.