Newbie - a few questions

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Newbie - a few questions

Post by nickg »

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

Re: Newbie - a few questions

Post by isiticov »

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/delphiglobalizat ... aq.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/delphiglobalizat ... aq.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).
nickg
Posts: 39
Joined: Tue Apr 05, 2005 9:17 am

Post by nickg »

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

Nick
Post Reply