hedgewars/hwengine.pas
branchhedgeroid
changeset 5644 4ad07103cfae
parent 5577 272c82f82cee
parent 5616 a96231121eac
child 5725 e27100a0e2d0
--- a/hedgewars/hwengine.pas	Sun Aug 21 22:18:54 2011 +0200
+++ b/hedgewars/hwengine.pas	Sun Aug 21 22:20:20 2011 +0200
@@ -234,6 +234,8 @@
     val(gameArgs[2], cScreenHeight);
     val(gameArgs[3], cReducedQuality);
     cLocaleFName:= gameArgs[4];
+    if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
+    else cLocale := Copy(cLocaleFName,1,2);
     UserNick:= gameArgs[5];
     isSoundEnabled:= gameArgs[6] = '1';
     isMusicEnabled:= gameArgs[7] = '1';
@@ -279,8 +281,6 @@
 
     LoadLocale(UserPathz[ptLocale] + '/en.txt');  // Do an initial load with english
     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
@@ -495,6 +495,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 begin
     GetParams();
+    if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
+    else cLocale := Copy(cLocaleFName,1,2);
 
     if GameType = gmtLandPreview then GenLandPreview()
     else if GameType = gmtSyntax then DisplayUsage()