Version: (using KDE 4.4.1) Compiler: all OS: Linux Installed from: Compiled From Sources Hello, Please replace the chinese flag to mongolian flag, or simply remove Chinese flag from mongolian entry in project setup dialog of Lokalize! You can find mongolian flag http://l10n.kde.org/img/flags/mn.png
It's an upstream bug in QLocale. #include <QApplication> #include <QLocale> #include <QString> #include <QDebug> int main(int argc, char* argv[]) { QApplication app(argc, argv); QString code = QLocale("mn").name(); qDebug() << code; if (code.contains('_')) code=code.mid(3).toLower(); qDebug() << code; return 0; } It's because of the line: if (code.contains('_')) code=code.mid(3).toLower(); Basically QLocale("mn").name() returns "mn_CN", and the code in LanguageListModel, then edits it to just "cn". Not sure what is the proper/standard format, QLocale("mn").country() returns the code 44, which is QLocale::China. but QLocale("mn").language() returns 82, which is correctly QLocale::Mongolian http://doc.trolltech.com/4.6/qlocale.html#name returns language_country format. I'm not sure what format KDE uses. but it seems to be conflicting in this case. I think it's best to poke other developers about this. on one hand, the bug is so far limited to how that code in lokalize tries to determine the correct flag based on the locale. On the other hand, it might have deeper problems right at the heart of KDE localization.
Thank you for the detailed information, Where and how can I inform about it to core developers? Is it enough to send a bug to qlocale developers?
I've reported it this morning, badral, I try to create a workaround for it until Qt developers fix it, thanks your patient. http://bugreports.qt.nokia.com/browse/QTBUG-9370
Laszlo Papp, Thank you for your effort! This locale (mn_CN) problem is a really general problem which should not be solved everytime so hardcoded. For this time it is ok. The locale for <a href="http://en.wikipedia.org/wiki/Mongolian_script">mongolian script</a> of <a href="http://en.wikipedia.org/wiki/Mongolian_language">Mongolian language</a> must not be named actually as mn_CN. (This locale is originally named so by buggy Microsoft.) Because, it is locale for Mongolian traditional script, which not only used in present <a href="http://www.answers.com/topic/inner-mongolia">inner mongolia</a> (An autonomous region of north China) but also Mongolia. This script has been supported by us in Unicode in year 2000. It is our tradional script and cultur! We have to pay an attention to it.
Nick, may I commit it ? We can remove it later, when Qt developers fixed it in their class, thanks in advance. svn diff ../../lokalize/src/common/languagelistmodel.cpp Index: ../../lokalize/src/common/languagelistmodel.cpp =================================================================== --- ../../lokalize/src/common/languagelistmodel.cpp (revision 1106480) +++ ../../lokalize/src/common/languagelistmodel.cpp (working copy) @@ -8,7 +8,7 @@ published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved - by the membership of KDE e.V.), which shall act as a proxy + by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, @@ -68,11 +68,15 @@ if (role==Qt::DecorationRole) { static QMap<QString,QIcon> iconCache; - + QString langCode=stringList().at(index.row()); if (!iconCache.contains(langCode)) { - QString code=QLocale(langCode).name(); + QString code; + if(langCode == "mn") + code = "mn_MN"; + else + code=QLocale(langCode).name(); QString path; if (code.contains('_')) code=code.mid(3).toLower(); if (code!="C")
SVN commit 1107827 by lpapp: Workaround for QTBUG-9370 - Mongolian flag problem BUG: 231220 M +6 -1 languagelistmodel.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1107827