Fix name Scottish Gaelic being incorrectly displayed in language dropdown
authorWuzzy <almikes@aol.com>
Fri, 07 Apr 2017 01:50:49 +0200
changeset 12180 7df59356471e
parent 12179 1eeb9a5b5b73
child 12181 c6984784c9fb
Fix name Scottish Gaelic being incorrectly displayed in language dropdown
QTfrontend/ui/page/pageoptions.cpp
--- a/QTfrontend/ui/page/pageoptions.cpp	Fri Apr 07 01:41:30 2017 +0200
+++ b/QTfrontend/ui/page/pageoptions.cpp	Fri Apr 07 01:50:49 2017 +0200
@@ -645,10 +645,20 @@
                     // Usually, we just print the language name
                     entryName = loc.nativeLanguageName();
                 }
-                // Fallback code: If language name is empty for some reason, print locale identifier. This should normally not happen
+                // Fallback code, if language name is empty for some reason. This should normally not happen
                 if(entryName.isEmpty())
                 {
-                    entryName = tr("MISSING LANGUAGE NAME [%1]").arg(lname);
+                    if(lname == "gd")
+                    {
+                        /* Workaround for Qt4: nativeLanguageName does not return correct name for Scottish Gaelic (QTBUG-59929),
+                           so we have to add it ourselves :-/ */
+                        entryName = QString::fromUtf8("GĂ idhlig");
+                    }
+                    else
+                    {
+                        // If all else fails, show error and the locale identifier
+                        entryName = tr("MISSING LANGUAGE NAME [%1]").arg(lname);
+                    }
                 }
                 CBLanguage->addItem(entryName, lname);
             }