=== modified file 'plugins/language/language-plugin.cpp'
--- plugins/language/language-plugin.cpp 2015-04-10 11:22:10 +0000
+++ plugins/language/language-plugin.cpp 2015-05-21 07:45:17 +0000
@@ -323,7 +323,17 @@
languageLocale.likely = likelyLocaleForLanguage[language] ==
i->left(i->indexOf('.'));
- languageLocales += languageLocale;
+
+ /* Only list locales with available translations, the locales are of format xx_YY.UTF-8,
+ if xx and yy are the same code it's the main locale for the language and we keep it,
+ we also list locales which have translations installed from langpacks */
+ QStringList installedTranslations(QDir("/usr/share/locale-langpack").
+ entryList(QDir::Dirs | QDir::NoDotAndDotDot));
+ if (languageLocale.likely ||
+ installedTranslations.indexOf(languageLocale.localeName.split(".")[0]) != -1) {
+ languageLocales += languageLocale;
+ }
+
}
qSort(languageLocales);