KMultiLanguage Delphi pack
version 2.0
- Main features
- Contents of the pack
- Installation
- Using
- How does it work?
- Properties and methods
- Distribution of the pack
- Agreements
- Copyrights
1. Main features
- Minimizing of the used resources: only ONE component per form or
data module, only ONE component in the pack (you don't need to install several
additional pages in your Delphi palette);
- Allows to change language of your application on fly;
- Works both during the design-time and the run-time;
- Language wizard allows you quickly to process the existing Delphi-project
to make it multilingual;
- Automatically traces all additions and removals of the components
on form;
- Does not require any change of your existing application, no limitations
for components placement, form loading or other;
- Simple in use: minimum properties and methods that you need to know
how for use;
- Language file editor can be deployed together with your application
to give the end user the opportunity to edit all captions and messages in
your program;
- New language support can be added to your application without changing
the source code;
- (new).
Custom setting of locale parameters for each language (date/time formats,
currency decimals, month and days list, etc.);
- (new).
Now the font change is available when language is switching;
- (new).
Language wizard now can process .PAS files and add all strings in the
language file;
- (new).
Language editor now shows the property name for each string;
- (new).
Synhronize function in the language editor helps you simply update
your language files when your project has been changed;
back
to top
2. Contents of the pack
- Component TkMLang
- Component TkMLang must be placed on each form in your project. It scans
all textual properties of the form or data module and writes them in a file
(language file). Then you can simply change the language of your application
by changing this file. You have to deploy language files with your application.
TkMLang component also allows change the language of your application both
at design or run time. Detailed description of all properties
and methods of the component see below.
- Language wizard
- With Language Wizard you can make your existing Delphi project multilingual
simply and fast. You just have to indicate the deafult(native) language of
your project and run the wizard. It automatically add kMLang component
in each form or data module of your project, create language file with indicated
name and save all captions, hints or other strings in this file. New capability
was added to the wizard in the version 2.0 of the pack. Now it allows to process
.PAS files and exclude all strings from them. You only need to choose which
strings have to be palced into the language file.
- Language Editor
- The Languge editor allows you to edit language files. It can change strings,
fonts, locale parameters and synhronize language files when one of them has
been changed. You can deploy language editor together with your application
to give an end user the opportunity to edit all captions and messages in your
program.
3. Installation
Installation of the wizard
To install wizard copy langwizr.dll file to the Delphi BIN directory.
Then start regedit.exe and choose Experts key for your Delphi
version. For example:
HKEY_CURRENT_USER\Software\Borland\Delphi\2.0\Experts
for Delphi 2.
Then you need to add new value to this key and indicate the path to langwizr.dll
file. For example:
LangWizard "C:\Delphi2\bin\lanwizr.dll"
After that you can start the wizard in Project | Language Wizard menu item.
Component installation in Delphi 2
1. Start Delphi;
2. Choose ‘Component | Install’ menu item;
3. Add the module kMLngReg.pas (button Add).
The component will be added on page System of a components palette.
Component installation in Delphi 3,4
1. Start Delphi;
2. Choose ‘File | Open file’ menu item;
3. Open the package file KMLang3.dpk (or KMLang4.dpk for Delphi 4);
4. Press the 'Install' buttom in the package window.
back
to top
4. Using
In general, to apply the given set to your project you have to do the following:
- You develop the project as usually without any reference to components
of the given package;
- When the project is ready, you start the expert (menu Project | Language
Wizard). Thus your project should be opened in current Delphi-session;
- You choose language of the project (for example 'English') and the expert
adds a component TkMLang to each form or data module of the project;
- After the end of the work of the expert, a new file will appear in the
project directory (in our case English.lng). All messages and captions
of your application are stored in this file;
- Then you run language file editor (langedit.exe) and set the work directory
(File | Work dir) to your project directory and the default language (English).
The strings list, fonts list and locale parameters for indicated language
will appear in the left panel;
- Then you can create new language file (File | Create New) for other language
(for example German or Italian) and edit all strings and locale parameters
for it;
- Now you can change the language of your application by changing the language
file. It is necessary only to set LangFileName property of TkMLang component
in one of the forms in the project. The value of this property in the components
in the other forms will change automatically. After the change of the LangFileName
property value all captions and messages in all opened forms of the application
will be changed at once;
- With addition of the new forms in the project it is necessary for you only
to add a component TkMLang to that form;
back to
top
5. How does it works
The component TkMLang keeps the list of the text properties like ‘Caption’
or ‘Hint’ of the all components of the form. The given list is stored in the
language file. For each property its name and number of a string is remembered.
With addition of the new components its text properties (like ' Caption 'or
‘Hint’ ') are kept in the list, and in the language file the new records
are automatically added.
back to
top
6. Properties and methods
KMLang component
- property LangFileName: string
- the name of the current language file without extension. You can change
the current language by changing this property value. The property LangFileName
of all TkMLang in other forms will change accordingly. Changes occure both
during design-time or run-time.
Unit kmlang
- function GetLangStr (Ident: Word): string
- returns the string with the number Ident from a current language
file. You can use it when it is necessary to show a message inside the program,
for example:
const
MsgWorkComplete = 1036
..........;
ShowMessage (GetLangStr (msgWorkComplete));
..........
Thus in the language file there should be a string with the index 1036. If
such number does not exist the exception ELangStrNotFound will be generated.
- procedure GetLangList (ALangs: TStrings)
- writes down in ALangs the list of all language files in the current directory.
An example of the use of the given procedure look in the demo project.
back to
top
7. Distribution
The given set is distributed as Shareware. Cost of the registration of one
license - 36$. Full source code costs 72$. The no time limit upgrade and technical
support is given to the registered users.
The demo-version is free. The expert and the language editor in the demo-version
is fully functional. The component TkMLang has one restriction: only the first
seven components on the form is processed.
Any additional agreements with the author to distribute demo-version of this
product on CD, or to place it to any WWW or FTP servers or any other distributing
both free or commercial are not required.
The wishes and bug reports are welcome from all users (not only registered).
E-mail address is specified below.
back to
top
8. Agreements
All rights are protected by the law of Ukraine and international laws. It is
forbidden to distribute the complete version of a product without the consent
of the author, excluding the language editor (file Langedit.exe), which user
can include in the delivery of own products.
To the registered users of the software, bought it together with a complete
source code it is authorized to make modifications and addition to a product.
It is also authorized to distribute changed software as an own product,
previously notified the author of the given product.
The author disclaims all warranties, expressed or implied, including,
without limitation, the warranties of merchantability and of fitness for
any purpose. The author assumes no liability for damages, direct or consequential,
which may result from the use of this package.
The author warns the user about necessity of creation of backup copies of source
code of the products for prevention of loss or damage of the data caused by
the given software product.
Do not use this software if you disagree even with one condition of this agreement.
back to
top
9. Copyrights
Copyright by Korzh 1998. All right reserved.
Idea and base development : Korzh Sergey.
Web-design and documentation : Korzh Sergey, Kovalyova Oksana
e-mail: korzh@parsmail.com
http://korzh.hypermart.net
Kyiv, Ukraine, 1998.