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 

How to translate FastReport labels?

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



Joined: 25 Aug 2006
Posts: 4

PostPosted: Thu May 29, 2014 9:42 pm    Post subject: How to translate FastReport labels? Reply with quote

Does anyone know how to translate FastReport?

I placed a FastReport (TfrxReport) component on a form; there is a TsiLanLinked on the form. I would like to translate the labels (TfrxMemoView fields) on the report, but canít figure out how.

I noted that in the Extended Translations the Report is shown but no TfrxMemoView fields under Report. Any suggestions would be appreciated!
Back to top
View user's profile Send private message
Malcolm



Joined: 21 Jan 2003
Posts: 84
Location: Scotland

PostPosted: Fri May 30, 2014 1:31 pm    Post subject: Reply with quote

Here is how I do it.

1. I create a var for each string as follows:

VAR
// translatable report strings
...
_total : STRING = ''; (* Total *)
...

2. write a procedure to update the strings when the language changes.

PROCEDURE TReportForm.UpdateStrings;
BEGIN
...
_total := SiLangRTReport.GetTextOrDefault('str_total'); // str_total is the StringID
...
END;

3. Now I can assign my strings to report variables as follows.

FrxReport1.Script.Variables['thetotal'] := _total;

It is a long time since I did this, but I think TsiLang Expert can help. Something to do with Consts section, I think.

But the above only translates the static text such as report captions. If you need to translate the report data you will have to translate it before passing it to the FrxReport.

I hope this points you in the right direction.
Back to top
View user's profile Send private message
LeighM



Joined: 25 Aug 2006
Posts: 4

PostPosted: Fri May 30, 2014 2:04 pm    Post subject: Reply with quote

Thanks Malcolm

isiticov mentioned "just place TsiLang component on report and you will be able to translate it." (see link below). So I was hoping that it can translate static text on report just as it does for TChart component; in that the caption/text on the report can be translated in Extended Translations.

http://www.sicomponents.com/forum/viewtopic.php?t=82&highlight=fastreport
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Fri May 30, 2014 2:29 pm    Post subject: Reply with quote

Since 2003 FastReport dramatically changed the structure and design of their report components and they don't provide any more access to their fields as usual VCL. So I would recommend Malcolm's suggestion too.
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