# HG changeset patch # User nemo # Date 1352217678 18000 # Node ID 619a399bece81ba86b3e92137a56f7b13ce6d1d1 # Parent dfba2515d60197719927f9fca2fc5b0d7c48e9df This should ensure zsm doesn't screw up locale, hopefully. diff -r dfba2515d601 -r 619a399bece8 hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Tue Nov 06 10:52:21 2012 -0500 +++ b/hedgewars/hwengine.pas Tue Nov 06 11:01:18 2012 -0500 @@ -386,7 +386,7 @@ if cLocaleFName <> 'en.txt' then begin // Try two letter locale first before trying specific locale overrides - if (Length(cLocale) > 2) and (Copy(cLocale,1,2) <> 'en') then + if (Length(cLocale) > 3) and (Copy(cLocale,1,2) <> 'en') then begin LoadLocale(UserPathz[ptLocale] + '/' + Copy(cLocale,1,2)+'.txt'); LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocale,1,2)+'.txt') diff -r dfba2515d601 -r 619a399bece8 hedgewars/uSound.pas --- a/hedgewars/uSound.pas Tue Nov 06 10:52:21 2012 -0500 +++ b/hedgewars/uSound.pas Tue Nov 06 11:01:18 2012 -0500 @@ -139,7 +139,7 @@ path:= Pathz[ptVoices] + '/' + locName; if DirectoryExists(path) then name:= locName - else if Length(cLocale) > 2 + else if Length(cLocale) > 3 then begin locName:= name+'_'+Copy(cLocale,1,2); diff -r dfba2515d601 -r 619a399bece8 hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Tue Nov 06 10:52:21 2012 -0500 +++ b/hedgewars/uVariables.pas Tue Nov 06 11:01:18 2012 -0500 @@ -21,7 +21,7 @@ unit uVariables; interface -uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uMobile; +uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uMobile, uUtils; var /////// init flags /////// @@ -2578,10 +2578,7 @@ procedure initModule; begin - if (Length(cLocaleFName) > 6) then - cLocale := Copy(cLocaleFName,1,5) - else - cLocale := Copy(cLocaleFName,1,2); + SplitByChar(cLocaleFName, cLocale, '.'); cFlattenFlakes := false; cFlattenClouds := false;