dxgettext to tsi

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
microtronx
Posts: 29
Joined: Tue Dec 21, 2010 7:34 pm

dxgettext to tsi

Post by microtronx »

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
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

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.
Best regards,
Igor Siticov.
microtronx
Posts: 29
Joined: Tue Dec 21, 2010 7:34 pm

Post by microtronx »

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.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

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.
Best regards,
Igor Siticov.
Post Reply