aboutsummaryrefslogtreecommitdiffstats
path: root/unicode/src/base/ULanguage.pas
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-07-26 13:11:59 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-07-26 13:11:59 +0000
commit89ba488aa027281cda5c32f9bda5b9d98913fc12 (patch)
tree147410a773489c570a1369f29c17c006c4035b41 /unicode/src/base/ULanguage.pas
parent59c10225f97f79ee4e702211b38dcd5493f05944 (diff)
downloadusdx-89ba488aa027281cda5c32f9bda5b9d98913fc12.tar.gz
usdx-89ba488aa027281cda5c32f9bda5b9d98913fc12.tar.xz
usdx-89ba488aa027281cda5c32f9bda5b9d98913fc12.zip
Language option fix:
- Never assume an order of the files returned by FindFirst/Next(). This will not work on linux as the order is random. - That is also the reason why the default theme on linux is random (usdx uses the first theme returned by FindFirst(). This is not fixed yet. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1924 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--unicode/src/base/ULanguage.pas30
1 files changed, 15 insertions, 15 deletions
diff --git a/unicode/src/base/ULanguage.pas b/unicode/src/base/ULanguage.pas
index 02615fed..5f8a2692 100644
--- a/unicode/src/base/ULanguage.pas
+++ b/unicode/src/base/ULanguage.pas
@@ -52,9 +52,9 @@ type
private
List: array of TLanguageList;
- Entry: TLanguageEntryArray; //**< Entrys of Chosen Language
- SEntry: TLanguageEntryArray; //**< Entrys of Standard Language
- CEntry: TLanguageEntryArray; //**< Constant Entrys e.g. Version
+ Entry: TLanguageEntryArray; //**< Entrys of Chosen Language
+ EntryDefault: TLanguageEntryArray; //**< Entrys of Standard Language
+ EntryConst: TLanguageEntryArray; //**< Constant Entrys e.g. Version
Implode_Glue1, Implode_Glue2: UTF8String;
@@ -113,9 +113,9 @@ begin
begin
ChangeLanguage('English');
- SetLength(SEntry, Length(Entry));
+ SetLength(EntryDefault, Length(Entry));
for J := 0 to high(Entry) do
- SEntry[J] := Entry[J];
+ EntryDefault[J] := Entry[J];
SetLength(Entry, 0);
@@ -226,10 +226,10 @@ begin
// Check if ID exists
//Const Mod
- EntryIndex := FindID(ID, CEntry);
+ EntryIndex := FindID(ID, EntryConst);
if (EntryIndex >= 0) then
begin
- Result := CEntry[EntryIndex].Text;
+ Result := EntryConst[EntryIndex].Text;
Exit;
end;
@@ -242,10 +242,10 @@ begin
//Standard Language (If a Language File is Incomplete)
//Then use Standard Language
- EntryIndex := FindID(ID, SEntry);
+ EntryIndex := FindID(ID, EntryDefault);
if (EntryIndex >= 0) then
begin
- Result := SEntry[EntryIndex].Text;
+ Result := EntryDefault[EntryIndex].Text;
Exit;
end;
end;
@@ -255,9 +255,9 @@ end;
*}
procedure TLanguage.AddConst(const ID: AnsiString; const Text: UTF8String);
begin
- SetLength (CEntry, Length(CEntry) + 1);
- CEntry[high(CEntry)].ID := ID;
- CEntry[high(CEntry)].Text := Text;
+ SetLength (EntryConst, Length(EntryConst) + 1);
+ EntryConst[high(EntryConst)].ID := ID;
+ EntryConst[high(EntryConst)].Text := Text;
end;
{**
@@ -267,11 +267,11 @@ procedure TLanguage.ChangeConst(const ID: AnsiString; const Text: UTF8String);
var
I: Integer;
begin
- for I := 0 to high(CEntry) do
+ for I := 0 to high(EntryConst) do
begin
- if CEntry[I].ID = ID then
+ if EntryConst[I].ID = ID then
begin
- CEntry[I].Text := Text;
+ EntryConst[I].Text := Text;
Break;
end;
end;