r20436 by craig -

scribus-commit scribus-commit at lists.scribus.net
Tue Sep 29 20:34:15 UTC 2015


Author: craig
Date: Tue Sep 29 20:34:15 2015
New Revision: 20436

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20436
Log:
#13386: Fix command line LC_ALL/LANG env vars not working

Modified:
    trunk/Scribus/scribus/scribusapp.cpp

Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20436&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp	(original)
+++ trunk/Scribus/scribus/scribusapp.cpp	Tue Sep 29 20:34:15 2015
@@ -333,6 +333,21 @@
 	if (!lang.isEmpty())
 		langs.push_back(lang);
 
+	if (!(lang = ::getenv("LC_ALL")).isEmpty())
+	{
+		if (lang=="C")
+			lang="en";
+		langs.push_back(lang);
+	}
+	if (!(lang = ::getenv("LANG")).isEmpty())
+	{
+		if (lang=="C")
+			lang="en";
+		langs.push_back(lang);
+	}
+	if (!(lang = ::getenv("LC_MESSAGES")).isEmpty())
+		langs.push_back(lang);
+
 	//add in user preferences lang, only overridden by lang command line option
 	QString Pff = QDir::toNativeSeparators(ScPaths::getApplicationDataDir());
 	QFileInfo Pffi = QFileInfo(Pff);
@@ -360,13 +375,6 @@
 		}
 	}
 
-	if (!(lang = ::getenv("LC_ALL")).isEmpty())
-		langs.push_back(lang);
-	if (!(lang = ::getenv("LC_MESSAGES")).isEmpty())
-		langs.push_back(lang);
-	if (!(lang = ::getenv("LANG")).isEmpty())
-		langs.push_back(lang);
-
 #if defined(_WIN32)
 	wchar_t out[256];
 	QString language, sublanguage;
@@ -398,7 +406,6 @@
 		if (langs.count(*it) > 1)
 			it = langs.erase(it);
 	}
-
 	return langs;
 }
 




More information about the scribus-commit mailing list