--- 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);