Unicode Controls & Classes for VB6 - Version 4

clsMultiLngsupport Class

This class permits you to translate your forms automatically (by applying UNICODE captions and tips to your controls and to the form) using a external .ini file created in a certain way.

Enums
Name Description
Events
Name Description
Properties
Name Type Description
Methods
Name Type Description
AddSection Adds a specific section from the given translation file to the list of translations
AddString Adds a specific value to a specific section in the translation collection
ApplyToCtrl Applies the translation to the specified control
ApplyToForm Translates the passed form
ApplyToFormName Translated a specified form using another name as section
GFS (String) Get Form String
Loads a string from the translation file using the "Id" parameter as a control name and the given form name as section
GGS (String) Get Global String
Reads a value from the Global section of the file (which is [GLOBAL])
GGS_Params (String) Get Global String Params
Reads a value from the Global section of the file (which is [GLOBAL]) and substitutes given parameters to %1 %2 %3 %4
GS (String) Get String
Loads a string from the translation file using the complete key
GSS (String) Get Section String
Gets a value from a specified section
Start Loads the translation file from the given path into memory
Remarks
The translation .ini file is a standard .ini file optionally in UNICODE UTF16LE format.

The translation file has to be in this way:
Create as many sections as forms' names:

[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] for retrieving the translation)

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


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 ([ctlUniMenu.eUniMenuStringMode]).