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 

Newbie - a few questions

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



Joined: 05 Apr 2005
Posts: 39

PostPosted: Tue Apr 05, 2005 10:13 pm    Post subject: Newbie - a few questions Reply with quote

Hi,
I'm currently evaluating TsiLang with Delphi 7 Pro, and must say I'm very impressed with what I've seen so far.

A couple of things to clarify if I may.

I have an Office add-in project which currently has all componets using Widestrings (from ElPack, EDOS now distributed by LMD). This was done because data pulled from the client apps is in widestring format.

Am I right in assuming that I could leave the components that are filled with data by the client (using the users locale language), but should change labels, buttons and anything I want translated to that language to standard Delphi components to get the best results from TsiLang?

This would not be a problem using GExperts.

I understand that I can change the charset easily to make the translation if I use Arial unicode MS font on the parent form and leave the Delphi components Parent font property set to true. Then I only have to code one change of charset and it will cascade through to the Delphi components

Is there a way to determine what the users locale language is or even better the currently used system font, and set the other components to a suitable font and charset?

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


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Wed Apr 06, 2005 5:05 am    Post subject: Re: Newbie - a few questions Reply with quote

nickg wrote:
Am I right in assuming that I could leave the components that are filled with data by the client (using the users locale language), but should change labels, buttons and anything I want translated to that language to standard Delphi components to get the best results from TsiLang?

You can either convert them to Delphi controls or use them without changes but it would help to use SetThreadLocale() to set thread's locale to needed code page in order conversions from Ansi (returned by TsiLang methods) to Unicode (used in ElPack controls properties) were performed propely. So just before changing language call SetThreadLocale() to set locale to needed code page, otherwise Delphi will use OS user's default code page to perform conversion and this is not always correct. Sample could be found at http://www.tsilang.com/delphiglobalizationtool_faq.html#17

nickg wrote:
I understand that I can change the charset easily to make the translation if I use Arial unicode MS font on the parent form and leave the Delphi components Parent font property set to true. Then I only have to code one change of charset and it will cascade through to the Delphi components

Yes, absolutely correct.

nickg wrote:
Is there a way to determine what the users locale language is or even better the currently used system font, and set the other components to a suitable font and charset?

To detect user's locale language you can either use SysLocale global variable or GetUserDefaultLangID from WinAPI. Details could be found at http://www.tsilang.com/delphiglobalizationtool_faq.html#18
Unfortunately, detection of system font won't help (at least on my opinion). I think this could be read from display settings stored somewhere in registry (because user can adjust these settings from Display Properties dialog).
Back to top
View user's profile Send private message
nickg



Joined: 05 Apr 2005
Posts: 39

PostPosted: Wed Apr 06, 2005 10:35 pm    Post subject: Reply with quote

Manu thanks for the prompt and informative reply. Your answer is most helpful

Nick
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