Tweak load order
authornemo
Wed, 27 Jan 2010 00:11:52 +0000
changeset 2719 0efcaa69d30c
parent 2718 666afa2de3b5
child 2720 a5111ec4d25f
Tweak load order
hedgewars/hwengine.pas
--- a/hedgewars/hwengine.pas	Tue Jan 26 23:04:19 2010 +0000
+++ b/hedgewars/hwengine.pas	Wed Jan 27 00:11:52 2010 +0000
@@ -276,10 +276,13 @@
 		InitIPC;
 	WriteLnToConsole(msgGettingConfig);
 
+	LoadLocale(Pathz[ptLocale] + '/en.txt');  // Do an initial load with english
 	if cLocaleFName <> 'en.txt' then
-		LoadLocale(Pathz[ptLocale] + '/en.txt');
-	LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocaleFName,1,2)+'.txt');
-	LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName);
+        begin
+        // Try two letter locale first before trying specific locale overrides
+        if Length(cLocaleFName) <> 6 then LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocaleFName,1,2)+'.txt');
+	    LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName);
+        end;
 
 	if recordFileName = '' then
 		SendIPCAndWaitReply('C')        // ask for game config