[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: QUESTION: KGlobal locale setLanguage language KDatePicker
From:       Lorenzo Delana <lorenzo.delana () virgilio ! it>
Date:       2005-08-18 17:27:43
Message-ID: 200508182034.48083.lorenzo.delana () virgilio ! it
[Download RAW message or body]

Alle 16:43, mercoledì 17 agosto 2005, Tomasz Grobelny ha scritto:
> On Wednesday 17 August 2005 17:21, Lorenzo Delana wrote:
> > I setup my application using #include <kapplication.h> and starting up
> > KApplication app (_argc _argv, "name");
> >
> > What problem maybe that I cannot change language of KDE library... ??
>
> Do you have name.mo installed?

note that kaddressbook, that use KDatePicker works with correct translation, 
so I think that all translation files (.mo) are correctly installed.

Here complete code to try:
---------------------------------------
#include <iostream>
using namespace std;

#include <kapplication.h>
#include <kglobal.h>
#include <klocale.h>

int
main (int _argc, char **_argv)
{
        KApplication app (_argc, _argv, "sample");

cout << "outputting language list" << endl;
QStringList l = KGlobal::locale () -> languageList ();
cout << l.join (", ") << endl;

cout << "switching locale to 'it_IT@euro'" << endl;
KGlobal::locale () -> setLanguage ((QString)"it_IT@euro");

cout << "current language is..." << endl;
cout << KGlobal::locale () -> language () << endl;

//      return app.exec ();
}

Compiling and running:
$ g++ -I$KDEDIR/include test-setlanguage.cpp -L$KDEDIR/lib  -lkdecore 
&& ./a.out

Result in:
--------------------
outputting language list
it, en_US, it_IT@euro, en
switching locale to 'it_IT@euro'
current language is...
en_US <------------------------- may be "it_IT@euro"

any hints appreciated
tnx


Lorenzo
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic