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 

TsiLang and GetText procedure

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



Joined: 12 May 2003
Posts: 12

PostPosted: Mon May 12, 2003 3:48 am    Post subject: TsiLang and GetText procedure Reply with quote

Hi there,

i'm trying on the GetText procedure for TsiLang, but i'm facing some problem.

If i'm using ,like say, WinXp with chinese support. The GetText procedure can't work properly as it seems that it cannot retrieve the text correctly. Crying or Very sad

But if i running my software under native chinese enviroment(e.g, Win98 big5 version). It work correctly.

How can i resolve this issue under WinXp wiv chinese support ? i didn't wan to develop my software and then switch to other OS to c the result.

Regards,
Ang Lik Huar
Back to top
View user's profile Send private message
dorin



Joined: 21 Nov 2002
Posts: 20
Location: House of Technics

PostPosted: Mon May 12, 2003 7:09 am    Post subject: Re: TsiLang and GetText procedure Reply with quote

magicang wrote:
If i'm using ,like say, WinXp with chinese support.

What you do you mean by chinese support? Are you sure you set the system locale to chinese? If not, go to Control Panel/Regional and language Options. Switch to Advanced tab. Select Chinese (xxx) from the language list.
It should work then...
magicang wrote:
The GetText procedure can't work properly as it seems that it cannot retrieve the text correctly.

What exactly does it return? Question marks, black squares, or just garbage?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
magicang



Joined: 12 May 2003
Posts: 12

PostPosted: Mon May 12, 2003 7:16 am    Post subject: Reply with quote

Hi there,

Thanks for the reply.

I have change the locale to chinese. But trace from the IDE, the gettext get a blank string.

regards,
Ang Lik Huar
Back to top
View user's profile Send private message
dorin



Joined: 21 Nov 2002
Posts: 20
Location: House of Technics

PostPosted: Mon May 12, 2003 8:02 am    Post subject: Reply with quote

I tried it on my system. The chinese string returned by GetText looked quite nice to me. (At least it wasn't blank.)

We could not reproduce the bug.
It would be nice if you send us a small sample project so we can track the bug.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
magicang



Joined: 12 May 2003
Posts: 12

PostPosted: Mon May 12, 2003 8:54 am    Post subject: Reply with quote

Hi,

Thanks for the quick reply !! Surprised

I think i found the problem. Because i add a new language, althought i have increase siLangDispatcher to my new language no. and i load my language file dynamically. This cause the problem.

Now, i manual set the file name for the siLangDispatcher once and run my program. It works.

Does it means that if i add a new language, i need to manaually set the file name for siLangDispatcher again ?

Regards,
magic
Back to top
View user's profile Send private message
gaivans



Joined: 29 Nov 2002
Posts: 71

PostPosted: Mon May 12, 2003 9:18 am    Post subject: Reply with quote

Hello,

If you need to load translations dynamically in run-time the preferable way to do it is:

...
if FileExists(TheNewFileName) then
begin
siLangDispatcher1.FileName := TheNewFileName;
siLangDispatcher1.LoadAllFromFile(TheNewFileName);
siLangDispatcher1.ActiveLanguage := TheWorkingLanguageNumber;
end;
...
Back to top
View user's profile Send private message AIM Address MSN Messenger
magicang



Joined: 12 May 2003
Posts: 12

PostPosted: Tue May 13, 2003 12:34 pm    Post subject: Reply with quote

Hi,

Now i having another problem.

The translation work great under winXp with chinese support. But while i bring the same .exe file and same .sil file to a native chinese OS. I got problem again.

This time, the showmessage dialog doesn't translate. I use somethings like ShowMessage(TsiLang.GetText('xxx')), it work under winxp but doesn't work in native chinese os and it return blank string to me. Crying or Very sad

any advice ?

Thanks a lot !!
Back to top
View user's profile Send private message
dorin



Joined: 21 Nov 2002
Posts: 20
Location: House of Technics

PostPosted: Wed May 14, 2003 7:04 am    Post subject: Reply with quote

Try using the GetTextOrDefault method instead of GetText.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
magicang



Joined: 12 May 2003
Posts: 12

PostPosted: Fri May 16, 2003 2:01 am    Post subject: Reply with quote

The GetTextOrDefault function also doesn't work for this. Crying or Very sad

Any idea ?

Regards,
Magic Ang
Back to top
View user's profile Send private message
magicang



Joined: 12 May 2003
Posts: 12

PostPosted: Fri May 16, 2003 7:09 am    Post subject: Reply with quote

Hi Dorin,

I think i have found the problem. It seems that althought it have load the language file, some of the things is not refresh.

Look into the source code of TsiLang , i add one more code beside the code u give me and it's work now.


if FileExists(TheNewFileName) then
begin
siLangDispatcher1.FileName := TheNewFileName;
siLangDispatcher1.LoadAllFromFile(TheNewFileName);
siLangDispatcher1.ActiveLanguage := TheWorkingLanguageNumber;
siLang.Loaded; // ?? Force the siLang to refresh it's data ?? Tsilang Bugs ???
end;


Regards,
Magic Ang Surprised
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Fri May 16, 2003 2:35 pm    Post subject: Reply with quote

Could you please send us the sample project which reproduces such behavior? And we will try to find where exactly the origin of problem is.
Thanks.
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