← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/odd_locale_fix into lp:widelands

 

Klaus Halfmann has proposed merging lp:~widelands-dev/widelands/odd_locale_fix into lp:widelands.

Commit message:
Fix udefined / unexpected bahviour in case LANG enviromane is empty.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/odd_locale_fix/+merge/352934

Falback to 'en' in case LANG is empty
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/odd_locale_fix into lp:widelands.
=== modified file 'src/base/i18n.cc'
--- src/base/i18n.cc	2018-04-07 16:59:00 +0000
+++ src/base/i18n.cc	2018-08-11 18:17:57 +0000
@@ -145,7 +145,9 @@
 		lang = getenv("LANGUAGE");
 		if (lang != nullptr) {
 			env_locale = lang;
-		}
+        } else { // Finall fallback in case we cannot find out anything (#1784495)
+            env_locale = "en";
+        }
 	}
 	locale = "C";
 	SETLOCALE(LC_ALL, "C");


Follow ups