Ubuntu Pastebin

Paste from debug at Thu, 21 May 2015 08:02:06 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
=== 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);
Download as text