Fix default language
Following scenario:
I have the de_EN format specified, but no default language configured, so falls back to en_US. But the default function returns the format, even if it does not exist:
sonnet.core: No language dictionaries for the language: "en_DE"
This is also confusing for the users, because en_US is correctly selected in the spellcheck and language dialogs.
The KCM where you configure the languages has a similar logic for the fallback:
QString lang = formatsConfig.readEntry("LANG", QString());
if (lang.isEmpty()
|| !KLocalizedString::availableDomainTranslations("plasmashell").contains(lang)) {
lang = QLocale::system().name();
}
if (!KLocalizedString::availableDomainTranslations("plasmashell").contains(lang)) {
lang = QStringLiteral("en_US");
}
Edited by Alexander Lohnau