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 

dxgettext to tsi

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



Joined: 21 Dec 2010
Posts: 8

PostPosted: Wed Dec 22, 2010 10:13 am    Post subject: dxgettext to tsi Reply with quote

We're currently using dxgettext.

How can we switch to tsi with i.e. following usage:

messagdlg( _('text translated with gettext'+#13+'second line of text'), mtinformation, [mbok],0);

The _() function is a wrapper for gettext(). As i can see, tsi splits the text into two seperate lines / texts.

Thanks for some help,

Yusuf
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Thu Dec 23, 2010 5:30 am    Post subject: Reply with quote

Hello,

After using TsiLang Expert to scan your source code you can just combine the second line into the first one (using Ctrl+Enter or menu Edit | Multiline Editor in Translations Editor). And then delete the call for second GetTextOrDefault() method. Also performing global replace
_( to just ( would be enough to eliminate the call for _() function.
Back to top
View user's profile Send private message
microtronx



Joined: 21 Dec 2010
Posts: 8

PostPosted: Thu Dec 23, 2010 6:26 am    Post subject: Reply with quote

Good morning Igor,

is it not possible, that we can extend tsi to scan only texts within _( ... ) + replace only the text.

If this is possible, we can create a new wrapper _() to use tsi instead of gettext.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Thu Dec 23, 2010 4:16 pm    Post subject: Reply with quote

Hello,

If you don't wish to remove _() call then you can leave the _() function call and let TsiLang translate the content inside of () using TsiLang Expert. Then just create new _() function, something like this:
function _(const S: string): string;
begin
Result := S;
end;
In this way you wouldn't need to make any replacement in your code for _() function.
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