GetTextW

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

GetTextW

Post by sysdba »

Hi,

I have 3 languages :
English
French
Chinese

When doing this (Chinese language is the ActiveLanguage) :

MyTntEditControl.Text:=MyTranslationDataModule.MySilang.getTextW('mystring');

The Text is : ÄÚÈÝ/Îı¾
Instead of :梓尨妏蚚氪

Why ?

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

Post by isiticov »

Because Datamodule doesn't have any font/charset information. TsiLang uses that to perform Ansi to WideString conversion. So the solution could be to convert datamodule to form and assign charset for Chinese. Actually, datamodule is quite similar to usual form that is not visible.
Best regards,
Igor Siticov.
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

Ansi...

Post by sysdba »

It will be very interested to store strings in unicode or UTF8 Format into TsiLang Editor...
No ?

Thanks
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

Post by sysdba »

I Have transfered my strings from the datamodule to a form and now question marks are displayed : ??
instead of th echinese string

?

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

Post by isiticov »

How did you transferred them? You can just copy and paste the whole TsiLang itself and this must work fine.
Best regards,
Igor Siticov.
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

Post by sysdba »

I have added the strings in the existing Tsilang component located on my main form
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

Post by sysdba »

OK I Find it,

I use

THackControl(MyControl).Text := siLang.GetTextW(...)
wich is a String instead of
TTntEdit(MyControl).Text := siLang.GetTextW(...)
wich is a WideString

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

Post by isiticov »

Did you use Copy/Paste or typed them directly? Do you have Charsets settings on main form and under Default Fonts (Translation Editor menu Tools->Default Fonts) for Chinese language?
Best regards,
Igor Siticov.
sysdba
Posts: 16
Joined: Wed Nov 30, 2005 9:30 am

ok

Post by sysdba »

See my previous post
(It seems that we have posted messages at the same time )

:D

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

Post by isiticov »

Yes, looks like posted at the same time :)
Best regards,
Igor Siticov.
Post Reply