El Dimecres, 5 d'agost de 2015, a les 14:48:32, Stephane MANKOWSKI va escriure: > Hi, > > I am the main developer of Skrooge and I have a problem since I migrated > to Qt5/Kf5. > > Indeed, even if Skrooge is translated in many languages, only 3 are > available in "Switch Application Language". > > > Be aware that, if I click on "Réglages par défaut" the application is > translated in french even if french is not available in the list. > > I tried to analyse with and here is my understanding: > 1-Available languages are installed like this: > > /usr/share/locale/ast/LC_MESSAGES/skrooge.mo > ... > /usr/share/locale/ca@valencia/LC_MESSAGES/skrooge.mo > ... > /usr/share/locale/en_GB/LC_MESSAGES/skrooge.mo > ... > /usr/share/locale/fr/LC_MESSAGES/skrooge.mo > ... > /usr/share/locale/pt_BR/LC_MESSAGES/skrooge.mo > ... > /usr/share/locale/zh_CN/LC_MESSAGES/skrooge.mo > /usr/share/locale/zh_TW/LC_MESSAGES/skrooge.mo > > 2-To fill the list, KSwitchLanguageDialog calls this method: > > void > KSwitchLanguageDialogPrivate::fillApplicationLanguages(KLanguageButton > *button) > { > QLocale defaultLocale; > QLocale cLocale(QLocale::C); > QLocale::setDefault(cLocale); > //we start with 2, because the 0 is AnyLanguage and 1 is C > for (int i = 2; i <= QLocale::LastLanguage; ++i) { > QLocale l(static_cast<QLocale::Language>(i)); > QString languageCode = l.name(); > if (l != cLocale && > KLocalizedString::isApplicationTranslatedInto(languageCode)) { > button->insertLanguage(languageCode); > } > } > QLocale::setDefault(defaultLocale); > } > > 3-For french, the languageCode is set to "fr_FR" and > KLocalizedString::isApplicationTranslatedInto(languageCode) return false. > This is normal, because the language code is "fr" and not "fr_FR" > > 4-If I do "sudo cp /usr/share/locale/fr/LC_MESSAGES/skrooge.mo > /usr/share/locale/fr_FR/LC_MESSAGES/skrooge.mo" then french is available > in the list. > > So, all languages with two digits are not available in "Switch > Application Language". > > *M**y question:* > Is it a bug in KSwitchLanguageDialog or is it due to a bad installation > of skrooge.mo file (for information, I use releaseme script) ?
Bug in KSwitchLanguageDialog and/or KLocalizedString::isApplicationTranslatedInto Cheers, Albert > > Regards. > Stephane >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<