Try to prevent locale problems:
authorunc0rr
Fri, 08 May 2009 18:20:06 +0000
changeset 2039 3001445b4500
parent 2038 8dd780e3023f
child 2040 7c366fc3c099
Try to prevent locale problems: - Consider only strings starting from numbers - Fill strings with en locale first
hedgewars/hwengine.dpr
hedgewars/uLocale.pas
--- a/hedgewars/hwengine.dpr	Fri May 08 18:18:39 2009 +0000
+++ b/hedgewars/hwengine.dpr	Fri May 08 18:20:06 2009 +0000
@@ -361,6 +361,8 @@
 if recordFileName = '' then InitIPC;
 WriteLnToConsole(msgGettingConfig);
 
+if cLocaleFName <> 'en.txt' then
+	LoadLocale(Pathz[ptLocale] + '/en.txt');
 LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName);
 
 if recordFileName = '' then
--- a/hedgewars/uLocale.pas	Fri May 08 18:18:39 2009 +0000
+++ b/hedgewars/uLocale.pas	Fri May 08 18:20:06 2009 +0000
@@ -53,7 +53,7 @@
 	begin
 	readln(f, s);
 	if Length(s) = 0 then continue;
-	if s[1] = ';' then continue;
+	if not (s[1] in ['0'..'9']) then continue;
 	TryDo(Length(s) > 6, 'Load locale: empty string', true);
 	val(s[1]+s[2], a, c);
 	TryDo(c = 0, 'Load locale: numbers should be two-digit: ' + s, true);