- Home - Products - Tech Support - Downloads - Order - Contact Us -
Localization Guru Sample Project (Page 2)
Now let's look at what had to be done to the Visual Basic source code for this sample project in order to localize it using Localization Guru.
First, two forms (ChoseLng.frm and LocGuruL.frm) and one module (LocGuruL.bas) were added to the project.
The ChoseLng.frm form is used to display the list of available languages that appears when the application starts (or if you switch languages while the application is running).
LocGuruL.frm is a hidden form that is never made visible. It contains an instance of the LocGuruCtl component which is where the localization engine is contained in the Lite version.
The LocGuruL.bas module contains three important sections:
Section 1. The Public variable gLG that is used throughout the application to refer to the localization engine (view code here).
Section 2. The Public Enum eLocGuruStringID definition (view code here) which is where the application programmer defines an enum value to refer to each string constant (that needs to be translated) in the application. If you have ever used a resource file to store string constants you know how messy things can get with assigning a unique ID number for each string resource. By using the eLocGuruStringID enum to refer to your string constants you don't have to come up with a unique ID number yourself and your code is a lot more readable (as you will soon see).
Section 3. The Public Function LocGuruGetS (view code here) is used to fetch each of the string constants used by the application. Basically, this function becomes a virtual "resource file" for each Native language string constant used in the application. It is important to understand that you do not use LocGuruGetS to handle the strings that are stored in the Forms, and the controls on these Forms, of your application. These strings are actually stored in your .FRM and .FRX files and they will be localized when the Form is loaded due to one line of code that you will add to the Form_Load event for each form you wish to localize. The only string constants that you must handle with LocGuruGetS are those that are defined within the application code.
Visual Basic is a registered trademark of Microsoft Corporation.
Copyright © 1998-2005 Beta-Sigma Data Systems LLC