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!
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.
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.