Page 2 of 2

Re: Stretching the envelope

Posted: Wed Jul 25, 2007 1:14 pm
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.

Stretching the envelope

Posted: Wed Jul 25, 2007 8:24 pm
by nickg
Got it, that solves everything, thanks for your help Igor.

Regards Nick

Stretching the envelope

Posted: Wed Jul 25, 2007 8:32 pm
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

Stretching the envelope

Posted: Wed Jul 25, 2007 10:21 pm
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

Posted: Thu Jul 26, 2007 6:12 am
by isiticov
What about German? Both work just fine on our side. May be you've changed Charsets or Fonts?

Testing the envelope

Posted: Thu Jul 26, 2007 7:22 am
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

Posted: Thu Jul 26, 2007 8:04 am
by nickg
Nope, still doesn't work. What font or charset did you think I might have changed?
--------------------
Regards, Nick

Posted: Thu Jul 26, 2007 12:34 pm
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.

Posted: Thu Jul 26, 2007 8:38 pm
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

Posted: Mon Jul 30, 2007 7:17 am
by isiticov
You may try with setting the CommaText property not loading from file, because it looks like it is origin of problem.