hedgewars/uLocale.pas
changeset 10127 7f29a65aa1e4
parent 10123 64e72781d344
child 10249 b47ac2c19de3
--- a/hedgewars/uLocale.pas	Sun Feb 09 19:00:13 2014 +0100
+++ b/hedgewars/uLocale.pas	Mon Feb 10 00:43:03 2014 +0400
@@ -40,7 +40,7 @@
     trevt_n: array[TEventId] of integer;
 
 procedure LoadLocale(FileName: shortstring);
-var s: ansistring = '';
+var s: ansistring;
     f: pfsFile;
     a, b, c: LongInt;
     first: array[TEventId] of boolean;
@@ -62,11 +62,16 @@
         if (s[1] < '0') or (s[1] > '9') then
             continue;
         TryDo(Length(s) > 6, 'Load locale: empty string', true);
+        {$IFNDEF PAS2C}
         val(s[1]+s[2], a, c);
         TryDo(c = 0, ansistring('Load locale: numbers should be two-digit: ') + s, true);
-        TryDo(s[3] = ':', 'Load locale: ":" expected', true);
         val(s[4]+s[5], b, c);
         TryDo(c = 0, ansistring('Load locale: numbers should be two-digit: ') + s, true);
+        {$ELSE}
+        val(s[1]+s[2], a);
+        val(s[4]+s[5], b);
+        {$ENDIF}
+        TryDo(s[3] = ':', 'Load locale: ":" expected', true);
         TryDo(s[6] = '=', 'Load locale: "=" expected', true);
         Delete(s, 1, 6);
         case a of