hedgewars/hwengine.pas
changeset 5107 d7fc678d78f4
parent 5066 d2684b6f02ce
child 5110 d48230ef9447
--- a/hedgewars/hwengine.pas	Tue Apr 05 20:28:44 2011 +0200
+++ b/hedgewars/hwengine.pas	Tue Apr 05 16:23:52 2011 -0400
@@ -266,11 +266,14 @@
     LoadLocale(Pathz[ptLocale] + '/en.txt');  // Do an initial load with english
     if cLocaleFName <> 'en.txt' then
         begin
+        if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
+        else cLocale := Copy(cLocaleFName,1,2);
         // 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');
         LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName);
-        end;
+        end
+    else cLocale := 'en';
 
     WriteLnToConsole(msgGettingConfig);