Ubuntu Pastebin

Paste from debug at Thu, 21 May 2015 08:11:50 +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
23
=== 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 08:11:31 +0000
@@ -323,7 +323,18 @@
 
         languageLocale.likely = likelyLocaleForLanguage[language] ==
                                 i->left(i->indexOf('.'));
-        languageLocales += languageLocale;
+
+        QStringList installedTranslations(QDir("/usr/share/locale-langpack").
+                                          entryList(QDir::Dirs | QDir::NoDotAndDotDot));
+
+        /* Only list locales that are the main ones (=likely) for a language,
+           or that are a variant of the language which has translations on disk
+           (by looking if the langpack directories include the locale, without its '.utf-8') */
+        if (languageLocale.likely ||
+                installedTranslations.indexOf(languageLocale.localeName.split(".")[0]) != -1) {
+            languageLocales += languageLocale;
+        }
+
     }
 
     qSort(languageLocales);
Download as text