SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

silang and for example freereport

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
Josef Koller



Joined: 13 Mar 2005
Posts: 14

PostPosted: Mon Mar 14, 2005 6:31 pm    Post subject: silang and for example freereport Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Tue Mar 15, 2005 6:25 am    Post subject: Reply with quote

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

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.
Back to top
View user's profile Send private message
Josef Koller



Joined: 13 Mar 2005
Posts: 14

PostPosted: Tue Mar 15, 2005 6:46 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Tue Mar 15, 2005 7:32 pm    Post subject: Reply with quote

TsiLang Expert's menu:
Tools -> Wizards -> Importing strings from PE file
Back to top
View user's profile Send private message
Josef Koller



Joined: 13 Mar 2005
Posts: 14

PostPosted: Wed Mar 16, 2005 4:52 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Wed Mar 16, 2005 7:05 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Josef Koller



Joined: 13 Mar 2005
Posts: 14

PostPosted: Thu Mar 17, 2005 9:05 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Thu Mar 17, 2005 1:04 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Josef Koller



Joined: 13 Mar 2005
Posts: 14

PostPosted: Fri Mar 18, 2005 9:04 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group