Results 1 to 3 of 3

Thread: How to load the translating file in KDE program?

  1. #1
    Join Date
    Apr 2006
    Posts
    12
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default How to load the translating file in KDE program?

    Hello,
    I have written a KDE GUI program in which the messages displayed in UI are in English.
    And now, I want to change the messages to another language.

    I found that in Qt by using "QTextCodec::locale()" user program can get the locale and then use the Qtranslator to load the corresponding qm file.

    But in KDE, I didn't find somthing like this to get locale and to load corresponding mo file.
    QTranslator can not load mo file!

    How should I do in KDE? And where my mo file should be placed, in /usr/share/locale/XX/
    LC_MESSAGES/abc.mo ?(assumes abc is my program's name)

    Thank you very much!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to load the translating file in KDE program?

    Maybe this will help ?
    http://developer.kde.org/documentati...18n-howto.html

    It seems that it is handled automatically by KLocale.

  3. #3
    Join Date
    Apr 2006
    Posts
    12
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: How to load the translating file in KDE program?

    I found many programs' source codes in KDE.
    All of them do not have the locale codes explicitily.
    When kapp begin running, it will get locale and find a mo file in /usr/share/locale/ according to the locale.

    the documentation just tells me how to extract a po file from source code.
    It doesn't say how to code in KDE program's main function.

    And, in KDevelop, there is a menu item "Add Translation...", you can choose a kind of language to generate a po file in po directory, but the file is NULL.
    I don't understand it.

Similar Threads

  1. read file from end to beginning..
    By soul_rebel in forum Qt Programming
    Replies: 11
    Last Post: 4th June 2012, 01:20
  2. SQLite-DB in a qrc file
    By Lykurg in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2006, 19:24
  3. Replies: 11
    Last Post: 4th July 2006, 15:09
  4. Opening swf file in the default browser
    By munna in forum Qt Programming
    Replies: 16
    Last Post: 5th May 2006, 09:33
  5. create file in another directory
    By raphaelf in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2006, 10:04

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.