silang and for example freereport

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Josef Koller
Posts: 14
Joined: Sun Mar 13, 2005 11:15 am

silang and for example freereport

Post by Josef Koller »

Hello,

is there any way to get the hint strings from a freereport component?
For example: In the preview of a freereport there are buttons for open file or size or save file, etc.

This buttons have hints. Can I change this hint stings with silang?

Many thanks

Josef
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

This will require some manual changes in FreeReport sources.
1. Add to FR_CONST the following function:

Code: Select all

function FRLoadStr(const Ident: Integer): string;
var
  ResRec: TResStringRec;
begin
  ResRec.Module := @hInstance;
  ResRec.Identifier := Ident;
  Result := LoadResString(@ResRec);
end;
2. Scan and replace all occurencies of LoadStr() in FreeReport sources to FRLoadStr();
3. Compile your project.
4. Using Resource Strings Wizard from TsiLang Expert select resource strings to translate and follow Wizard steps.
5. Translate imported strings and re-compile your project.

After these steps FreeReport hints and captions should be translated.
Josef Koller
Posts: 14
Joined: Sun Mar 13, 2005 11:15 am

Post by Josef Koller »

Hello,

I done the steps you wrote
Function in the FR_CONST
Rename all Loadstr() into FRLoadStr()
compile and install freereport again

than I built a testproject with same buttons and hints and a frreport1
than I saved and compiled this testproject.
After starting the TsiLang Expert I saw my form but I saw no hints from the frreport1-preview and I found no Resource Strings Wizard.

What's wrong?

Thanks again and

best regards

Josef
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

TsiLang Expert's menu:
Tools -> Wizards -> Importing strings from PE file
Josef Koller
Posts: 14
Joined: Sun Mar 13, 2005 11:15 am

Post by Josef Koller »

Hello,

it doesn't works so as I wish.
I pressed the button importing strings from PE file and I shaw in the wizard my applicationname test.exe. After next I saw a grayed dfm file, no languages etc. so I closed the wizard.

Than I pressed at first the button change TSiLang Type to and than tsiLang (but this component was on the form before). After them I got the message save changes to form1.pas. I pressed Yes After this operation I started the wizard again and I got the strings. than I closed and opened the translation. But at first I saw no strings. After I clicked with the mouse to other propertiers Dialogs or hints, etc. and after returning to strings I saw A fragment of the stringlist and a message not guilty index and delphi was closed with the message unguilty operation .....

After opened Delphi again I got the strings. I translated the strings, closed and saved. Than I gave a button the command "silang1.ActiveLanguage:=2;"
But after compiling and opening the exe in the freereport preview are only German hints by moving the mouse over the buttons.
I built two languages (German and english).

Do you have any ideas for correct handle this Pe file wizard?

Many thanks and best regards

Josef
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Did you run the Wizard till the end? After Wizard completed all your selected strings should be added to Strings section of TsiLang and be sure the following properties have the values:
1. HandleResourceStrings = True
2. ResourceLanguageIndex = INDEX_OF_YOUR_RESOURCE_STRINGS (in case your resource strings are in German and TsiLang has German- 1st and English- 2nd, then this property value shall be 1)
3. You've provided translations in TsiLang for imported resource strings.

Please let us know if this help.
Josef Koller
Posts: 14
Joined: Sun Mar 13, 2005 11:15 am

Post by Josef Koller »

Hello,

thanks for answer. No, it doesn't works.

I tested with
HandleResourceStrings = True
and
HandleResourceStrings = True

the same result.

I done the following steps

load the testptoject in Delphi
open the TsiLabg Expert
give to languages (German, english) by press button File-> languages
doubleclick to the form
give the english words into the second column for captions and dbgridtitlecaption
close and save
than I started the wizard importing strings from PE file the same result
on the second site I see no language paramters. than I clicked the button
change tsilang type to tsilang than I get the dfm-form and the next button on the second site of the wizard. After next I get a stringlist and I marked same strings
(for example open report, save report...the hint strings of a standard preview) and pressed the button finish. The next site of the wizard have the message Wizard have finished ..... and I can press the button close (finish is grayed).

After close I started translation editor (double click to the file and clicked to the strings property nothing. than I clicked to the dialog property and get the message

Delphi32
This application will be closed by an unguilty transaction
after pressing the Button Details I get the following declaration

DELPHI32 verursachte einen Fehler durch eine ungültige Seite
in Modul VCL40.BPL bei 016f:400085e1.
Register:
EAX=4000b2b4 CS=016f EIP=400085e1 EFLGS=00010283
EBX=4000b2b4 SS=0177 ESP=0059fdd0 EBP=005a0358
ECX=00000000 DS=0177 ESI=005a0354 FS=0d67
EDX=005a0354 ES=0177 EDI=005a0458 GS=0000
Bytes bei CS:EIP:
68 00 04 00 00 8d 44 24 04 50 8b 43 04 50 8b 03
Stapelwerte:

After press Button close and restart Delphi I have the strings in the translation editor.
After translation the English words in the second column and close and save and gave
silang1.ActiveLanguage:=2;
to a buttonclick Icompiled the application and started it. But I have only the German button hints in the report review.

I have no Idea what's wrong?

Beste regards

Josef
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Do you see on second page your DFM file selected where TsiLang is placed? I don't see a reason why you need to use "Change TsiLang type".
Are your report strings in English not German? In case they are in English then you must add imported values to English column and provide translations for German and also set ResourceLanguageIndex to 2 because English is your second language.
Can you send us this test project and we will investigate in details what is wrong?
Josef Koller
Posts: 14
Joined: Sun Mar 13, 2005 11:15 am

Post by Josef Koller »

Hello,

I will be crazy. Yes, it works fine. The problem was:

I didn't close the unit before I called the PE file wizard.

Thanks for help and best regards

Josef
Post Reply