Stretching the envelope too far?

All announcements, questions and issues related to the TsiLang Components Suite.
isiticov
Site Admin
Posts: 2416
Joined: Thu Nov 21, 2002 3:17 pm

Re: Stretching the envelope

Post by isiticov »

Hi Nick,
nickg wrote: It stops the access error, but there is still a problem with the multi-line property ControlTexts used to store dialog button captions. It seems to be accessing the wrong item in the array, with the text for OK being displayed on the Yes button, when Yes and No are selected, and the No button is left blank. When the OK button is the only one set to show, it comes up blank too.
It looks like the index is 2 too high and part of the array is being left with empty strings.

It looks like an error in ElPack ElWideStrings.CommaText property realization.

If you try the code:

Code: Select all

ElMemo1.Lines.CommaText := WideString('Äà,Íåò,Î''ÊÅÉÎ,Îòìåíà,"Ïðåêðàùåíè ïðåêðàùåíèå","Ïîâòîðåííàÿ ïîïûòêà",Ïðîèãíîðèðóéòå,Âñå,"Íå ê âñåì","Äà ê âñåì",Ïîìîùü,"Ïîêàæèòå ñëåäóþùåå âðåìÿ","%d âðåìåííî îòêîìàíäèðîâûâàåò íàëåâî"'); 
(Garbage are the Russian characters from your SIB file)

You will notice that text will be displayed incorrectly in memo.
I noticed when stepping through the code, that when the code removes the & signs it seems to remove some of the text as well, for instance N&o to All, removes the N as well as the &, leaving the text as o to all.
There is no removing of & char envolved at all.
Also the dialog on the data module isn't causing an error, but it isn't being translated at all.
Data module named in project as DM but in SIB file it is named as TDataModule1.
Best regards,
Igor Siticov.
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Stretching the envelope

Post by nickg »

Got it, that solves everything, thanks for your help Igor.

Regards Nick
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Stretching the envelope

Post by nickg »

How about this?
unit si_ElPack;

if Obj is TElWideStrings then
begin
mStrings := TElWideStrings(Obj);
mStrings1 := TElWideStringList.Create;
try
mStrings1.CommaText := AnsiStringToWideStringCP(S1, AccesssiLang.CurrentCharset);
AWasSorted := False;
// if mStrings is TElWideStrings then // this class is only parent
for TElWideStringList so this is incorrect for TElWideStrings and previous
classes in hierarchy
// replace on:
if mStrings is TElWideStringList then
begin
AWasSorted := TElWideStringList(mStrings).Sorted;
TElWideStringList(mStrings).Sorted := False;
end;

Nick
Last edited by nickg on Wed Jul 25, 2007 11:04 pm, edited 2 times in total.
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Stretching the envelope

Post by nickg »

I changed the name of the datamodule back to DataModule2, but the Russian translation comes up like the garbage text in your message.

Nick
isiticov
Site Admin
Posts: 2416
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

What about German? Both work just fine on our side. May be you've changed Charsets or Fonts?
Best regards,
Igor Siticov.
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Testing the envelope

Post by nickg »

There aren't any fonts or charsets stored in the DataModule2 section of the sib file, I thought that might be the problem.

My dialog is set to use ArialUnicodeMS and it starts with ANSI_CHARSET.
I tried changing the charset programatically like this when the bottom button is clicked:

Case DataModule2.siLangDispatcher.ActiveLanguage of
1: DataModule2.DlgDM.Font.Charset := ANSI_CHARSET;
2: DataModule2.DlgDM.Font.Charset := RUSSIAN_CHARSET;
3: DataModule2.DlgDM.Font.Charset := ANSI_CHARSET;
end;
DataModule2.DlgDM.ShowModal;

But the Russian text still showed as garbage. the German is OK but it uses ansi anyway.

Is your system set up for Russian fonts anyway, or could there be something on mine that is stopping this from displaying properly.

I'm going to try this on another machine to see if that helps.

Regards, Nick
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Post by nickg »

Nope, still doesn't work. What font or charset did you think I might have changed?
--------------------
Regards, Nick
isiticov
Site Admin
Posts: 2416
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Yes, I think it doesn't work on our side as well because German umlauts are not diplayed correctly in dialog text.
Did it worked before? Because it looks again like ElPack problem, it doesn't show the text properly in prompt text but show it well in dialog captions and buttons.
Best regards,
Igor Siticov.
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Post by nickg »

Hi Igor,
I tried putting translations into text files and loading them into the dialog multiline properties using code like this:

DataModule2.DlgDM.Captions.LoadFromFile('Captions.txt');
DataModule2.DlgDM.ControlTexts.LoadFromFile('Controls.txt');
DataModule2.DlgDM.Texts.LoadFromFile('Texts.txt');
DataModule2.DlgDM.ShowModal;

Everything was displayed perfectly.

Regards, Nick
isiticov
Site Admin
Posts: 2416
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

You may try with setting the CommaText property not loading from file, because it looks like it is origin of problem.
Best regards,
Igor Siticov.
Post Reply