V.2.9
clsMultiLngSupport

This class permits you to apply UNICODE captions and tips to your controls automatically basing on an external UNICODE .ini file made in a certain method.

How to create the translation file:
It is a normal .ini file optionally in UNICODE format.
Create as many sections as forms' names in this way:

[form1] <-- the name of the form to translate
form1=pippo <- the caption of the form
button1=Press Here <- button1 caption
button1.Tip=Press this button <- button1 tip
...
[form2] <-- the name of the form2
...

It's possible to add special chars: [cr] for adding a line feed, # for adding comments, %1-%2-%3 for adding parameters (use the GGS_Params)

How to use this class:

1- create a global instance of the class
dim moMultiLngSupport as new clsMultiLngSupport

2- load a certain language using the Start method (only one time)
moMultiLngSupport.Start "arabic.lng","Arial Unicode MS"

This method takes two parameters, the first is the name of the translation file, the second (optional) is the name of an UNICODE FONT Name to apply to every control.

3- in the Load event of forms call the ApplyToForm method
moMultiLngSupport.ApplyToForm Me

ATTENTION
When translating a menu item this class passes the translation encoded using the Hex encoding, so your menu must have the
StringMode property set to Hex.

Methods:
ApplyToForm Translates the form
GFS Get Form String
Loads a string from the translation file using the "Id" parameter as control name and the given form name as section
GGS Get Global String
Reads a value from the Global section of the file (which starts with [GLOBAL])
GGS_Params Get Global String with Parameters
Reads a value from the Global section of the file (which starts with [GLOBAL]) and substitutes the given parameters to %1 %2 %3 %4 strings if found in the translation
GSS Get Section String
Gets a value from a section in the file
Start Loads a .ini translation file and optionally apply a certain font to controls
http://www.hexagora.com
Wed, 11 Mar 2009 12:43:19 UT
Copyright 2003-10 by Lorenzi Davide