hedgewars/hwengine.pas
changeset 5111 d8856d98ce7d
parent 5109 6d2e8a24277e
parent 5110 d48230ef9447
child 5130 3602ede67ec5
--- a/hedgewars/hwengine.pas	Wed Apr 06 00:29:49 2011 +0200
+++ b/hedgewars/hwengine.pas	Wed Apr 06 00:30:02 2011 +0200
@@ -260,13 +260,16 @@
     InitKbdKeyTable();
 
     LoadLocale(Pathz[ptLocale] + '/en.txt');  // Do an initial load with english
+    if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
+    else cLocale := Copy(cLocaleFName,1,2);
     if cLocaleFName <> 'en.txt' then
         begin
         // Try two letter locale first before trying specific locale overrides
-        if (Length(cLocaleFName) > 6) and (Copy(cLocaleFName,1,2)+'.txt' <> 'en.txt') then
-            LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocaleFName,1,2)+'.txt');
+        if (Length(cLocale) > 2) and (Copy(cLocale,1,2) <> 'en') then
+            LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocale,1,2)+'.txt');
         LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName);
-        end;
+        end
+    else cLocale := 'en';
 
     WriteLnToConsole(msgGettingConfig);