[KDE] Localisation avec KLocale
Bonjour,
Je n'arrive pas à utiliser la localisation de KDE avec KLocale. J'ai suivi ce document mais je ne comprends pas ce qui se passe. Voilà mon code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
KLocale::setMainCatalog("myapp");
qDebug() << KLocale::defaultLanguage();
qDebug() << KLocale::defaultCountry();
KAboutData about(
"myappp",
0,
ki18n("My application"),
blabla..);
KApplication app;
qDebug() << KLocale::locale()->language();
qDebug() << KGlobal::locale()->country();
Fenetre * fenetre = new Fenetre();
fenetre->show();
return app.exec(); |
Ca me retourne :
Code:
1 2 3 4 5
|
"en_US"
"C"
"en_US"
"ca" |
alors que ma variable d'environnement LANG=fr_CA.UTF-8.
J'ai bien un fichier myapp_fr.mo créé à partir d'un fichier po avec comme entete :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-05 12:00-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" |
Et bien sûr, le plus important, ca ne traduit rien dans ma fenêtre.
Est-ce qu'il y a quelque chose qui cloche dans ce que j'ai fait?
Merci