software preview: TMultiLang


 
Go
Introduction
Screen Shots
More Screens
Download
Architecture
FAQ
Order Info
Testimonials
Translators
Contact
 


Enter your e-mail address to receive e-mail when this page is updated.
This service is FREE.


What is the DoNot property good for?
The DoNot property stores all the controls which you do not want to get translated. They are set in the string editor by "Edit | Toggle Control" or clicking on the blue dot on the left edge.
See also the following tip: How to avoid translation of "empty" strings

back to top


How to avoid translation of "empty" strings
A typical case for this is a TPanel object with no caption. You will not have this in your string table since there is nothing to translate.

In the string table, select the component which you do not want to translate (e.g. 'Panel1').
Then use menu function "Edit | Toggle Control" - the blue button on the left will be replaced by a red one.
Then hit 'alt + R' or use menu function "View | Refilter") to filter out these "red marked" components.
All these components will be stored in string table "Do not".

Purpose: Components without text or with international text (e.g. 'Ok') will not be included in the string table; a smaller string table keeps your application smaller. back to top


How to translate the OK/CANCEL/HELP of MessageDlg
Instead of Borland's MessageDlg function, you should use

Application.MessageBox()
It will appear with the buttons that are provided from Windows. If you run an English Windows Version, it appears as 'Cancel'. A German Windows installation will display a 'Abbruch' button etc.

back to top


Source code files (*.pas) that have no form (*.dfm)
For strings in units, you have to use the .GetText method and add pseudo entries in the string table that start with a '@'.

Where do you place the TMultiLang component if there is no form?
The best idea is to create a TDataModule and to put a TMultiLang on it. Then you can reference like this:

with DataModule1.MultiLang1 do
  ShowMessage (GetText ('@hello'));
back to top


Constant strings in Pascal code, not on form
For those embedded strings, you have to use the .GetText method and add pseudo entries in the string table that start with a '@'.
The demo shows that at one point: when you click on the button on the first tab, a messagebox (ShowMessage) pops up.

Source code: instead of

       ShowMessage ('Hello World')
now:
       ShowMessage (MultiLang1.GetText('@hello'));
and in the string table:
       @hello      Hello World      Hallo Welt  ...

How do you get all those strings?
Unfortunately, you currently have to collect them manually. Let me give you a tip how I identify string constants really easily. I change in the IDE the editor's colors for strings to something very unusual, like 'Black text on RED background'. (Everything else is displayed on white background).
back to top


Where are the translations stored?
The translations are stored in your *.DFM files. When you are in the IDE and the translated form is open, click on the form (so that not the source, but the form is in foreground) and then hit ALT+F12.. you will see more then..

At run-time, the translations are compiled in the executable file.
back to top


How do I uninstall TMultiLang?
The latest versions of the component TMultiLang create a folder with a link to an automatic uninstall program.
If you do not have the latest version and just deleted the files, you will notice a request for the deleted Expert (file MultiLangExpert.DLL) every time you start Delphi.

  1. delete the directory in which you installed TMultiLang, e.g. c:\MLang3 and remove this directory from the library search path
  2. if you did not create a new directory, you need to remove these files:
    1. MultiLang*.*
    2. MLang.*
    3. MLBase.pas
    4. User*.inc
    5. Vendor.txt
    6. Readme.txt
  3. remove the subdirectory \DEMO
  4. run regedit
  5. open key (if Delphi 3)
    "HKEY_CURRENT_USER\Software\Borland\Delphi\3.0\Experts"

    On the right side, there is an entry "MLang". Delete it.
    For Delphi 2, the key name is
    "HKEY_CURRENT_USER\Software\Borland\Delphi\2.0\Experts"

back to top


Can I have more than one external translator?
Yes. You will do this the following way:

  1. complete your programming - finish the form design
  2. place a TMultiLang component on the form
  3. export the table of strings as an CSV file and hand it out to each of your translators
  4. they will return translations named english.csv, french.csv, spanish.csv.
  5. use the "import csv" function in the file menu to load the first translation english.csv
  6. use the "add csv" function in the file menu to add all other languages

back to top


What about the copyright? May I modify the source code?
Yes, of course you may modify the source code.
After all, that's why you get it.

You may

  • use the component in all your applications
  • make changes to the source code as you need to (it'll be nice if you'd inform me about improvements so everybody can benefit)
  • sell your application, but not the source code of TMultiLang
You may not
  • distribute the source code of TMultiLang
  • change the source code of TMultiLang slightly and distribute it as a competitive product
  • distribute the .DCU file of the registered version
I think that these rules are common sense for everybody.
back to top


Is there a 16bit-version for Delphi 1?
No.
There will not be a 16bit-version in future either. Research showed that it would be to much effort compared to the extra sales that can be expected.
Sorry, Delphi 1-users; you have to look for another solution.
back to top


Can I translate my texts externally?
Yes - the built-in string-editor has two buttons to export and import data using the CSV file format.
Several standard programs like Excel and Access can read the CSV format. Both programs are suitable for external translation.
Finally you may read the CSV file in your word processor; maybe improving the appearance using a macro.
back to top


Long strings in Doublebyte-charsets
Text that is wrapped by VCL components may be garbaged.
Quoting Ashley Saldanha, a user of TMultiLang:
   Compatibility only extends to single lines of text.

   Components that auto-wrap to a second line (e.g., message box strings,
   TLabels, TMemos, etc.), are likely to be corrupted, because a double
   byte character could be broken into two character bytes, causing garbage
   at the end of the wrapped line and beginning of the new line...

   To get around this, programmers should try to use shorter strings
   with manual breaks and then concantenate them.

   This is not, of course, a bug in MLang, but rather a limitation
   MLang inherits from the VCL...

back to top


Does it work with Delphi 3?
Delphi 3 does compile TMultiLang's source code without changes.
Tests have shown that the executable file works reliable as with Delphi 2.
back to top


What about file open/ save dialogs?
TMultiLang doesn't contain special versions of the file open dialog etc, since if e.g. a dutch user uses your dutch version of the program, there will be a dutch version of Windows running. So these dialogs will appear in Dutch automatically.

To say it shortly: these standard dialogs are a part of Windows, not of your application.

Of course, you have to take care of the filters and title text of such components, which is done by TMultiLang. (Title text since version 1.9)
back to top


Using TMultiLang blows up my EXE file
Yes, you're right, it increases the size of a small application a lot. The reason is very simple:

TMultiLang needs to know about all existing controls, such as those from COMCTRLS. E.g. even if your program doesn't contain a status bar, TMultiLang contains the code to handle a status bar.

Programs that use most controls do not get blown up a lot. They use COMCTRLS and all those other units anyway.
Since version 2.2 of TMultiLang, you can undefine the symbol SUPPORT_DB. If your application is not a database application, change the line {$DEFINE SUPPORT_DB} in file MLang.pas to {.$DEFINE SUPPORT_DB} Database-related components will not be supported by TMultiLang and not be linked in the EXE-file. This saves about 180kB.
back to top


How do I get smaller EXE files?
If you want to get a optimal (small) EXE, take the source code of TMultiLang, make a copy in your project directory and in this copy, comment the parts you don't use out. This would be at 3 places in the source code:

  1. in routine BtnUpdClick(Sender: TObject); which is called when you hit the "update" button
  2. at the "output" part in the source, the same program structure appears again. Take out the same controls..
  3. at the "input" part in the source, look for the controls that are not used, e.g. TStatusBar or TMemo etc.
Each control is handled in 2 lines, example:

-----------------
    (Components[i] is TTreeView) or
......
  else if aComponent is TTreeView then
    WriteTreeView ((aComponent as TTreeView).Items)
......
  else if aComponent is TTreeView then
    ReadTreeView ((aComponent as TTreeView).Items)
-----------------
Comment out all these 5 lines, and the code for TTreeView will no longer be in your code!
back to top


Can I get rid of the string editor in my EXE file??
No. Since the program cannot call the property editor, it is not included in the EXE file <smile>.
back to top


Will it work for Asian languages?
Yes, wide-chars will work fine even with the shareware DCU!
Ashley Saldanha wrote the following about this:
"I've installed Traditional Chinese Windows and Delphi, and tried your demo - and it does, indeed, work...
A tribute to a well-designed program. My compliments..."


back to top


Does it support embedded strings?
Yes - since version 1.8. TMultiLang has now a new method .GetTexts to access strings that are not attached to any control on the form.
See the demo project for a sample how to use this method. It is called in the button's OnClick event handler.
back to top


Does it work with Oracle, too?
Yes. TMultiLang is in no way bound to a specific database. The demo program which comes with the shareware version does use a Paradox table to demonstrate the ability to handle TDBStringGrids only. TMultiLang itself is not a database-related product and therefore works with any BDE-supported database.

back to top

How to remove a language again
Currently, only the last language(s) which means those displayed rightestmost in the table can be removed by setting the property "Languages" to a smaller value.

By the way, the number of languages can be increased by setting the property higher as well.
back to top


Translate MDI child forms
Each instance of a MDI child forms has a unique name, created at runtime. Therefore, the caption of MDI child forms cannot be translated by assigning strings to the form's name (Form1, Form2 etc.) as usually.

Since version 1.5, TMultiLang can access the form's caption property with the symbolic name %Form%.
For non-MDI-child forms, you still can use the form's name.
back to top


Cannot install on Delphi 2.0
There are slight differences in some DCUs for Delphi 2.0 and Delphi 2.01.

The file MLANG.DCU will work with Delphi 2.01, which is the currently actual version.
If you are working with Delphi 2.0, you may install MLANG20.DCU instead. Please copy MLANG20.DCU as MLANG.DCU in this case.
back to top


Translate a TStrings property
Q: How can I translate a TStrings property of a third-party component?
A: If the property is not supported by TMultiLang, you need to register the source code. It is only writing about 5 lines of code to do that because there are already other components with TStrings-properties, that are translated.
back to top


How is the BDE supported?
Q: Can I translate BDE messages with TMultiLang?
A: No. The current version of TMultiLang allows you to change caption, hints or other displayed contents of controls on your form only. It also allows you to translate the field labels in TFields.
For international versions, you can purchase Borland's localized BDE or - a lot cheaper - do enough checkings in your software so that BDE will not pop up message boxes like

"Do you really want to delete this record?"

However, true localization also means change of display of date (Christmas is 25.12. in many countries, but e.g. in the USA, it is 12/25/) .. and such things. Check out Windows' system routines for this.
back to top


Is the BDE required?
Q: Does it require BDE to be installed on the clients system?
A: No. TMultiLang does not use a TTable to store the strings. It uses a TStringGrid to display and edit them.
There is no external Paradox *.DB file or so for the texts.
back to top


Add support for new components
Currently this can be done only if you have the source code of TMultiLang.
Look for these procedures in file MLang.pas:

procedure TFEditMultiLang.WriteComponent (aComponent : TComponent; const aRow : integer);
and
procedure TMultiLang.ReadComponent (const aComponent : TComponent; var Position : integer);

Both distinguish between certain types of components before they use a default processing. If you want to add your (or a third-party) component, you need to add code checking for the type and handle it as in the other cases. You can use those generic procedures to handle properties that are of type TStrings, TStatusPanels, string, Hint (=string, if it exists).
back to top


YOUR question or tip

Name:   (optional)

Email:    (optional)

back to top


© Copyright 1996-2003. All rights reserved. Contact: Peter Tiemann