TsiLang Users Guide
TsiLang Users Guide
Developers
Guide
Developers Guide
Table of Contents
Introduction................................................................................................5
Welcome!............................................................................................................................................... 5
How to Use This Manual...................................................................................................................7
Contact Information........................................................................................................................... 8
Getting Started..........................................................................................9
Installation............................................................................................................................................9
Trial Version.....................................................................................................................................................9
On Windows:
Registered Version.........................................................................................................................................10
VCL Edition:.........................................10
CLX Edition:.........................................10
On Windows:
10
On Linux:
11
Components Review......................................................................................................................... 12
Main Components.........................................................................................................................................12
Dispatcher.......................................................................................................................................................13
Tutorial................................................................................................................................................ 15
Which components to use?
15
Setting properties
16
Using siDialogs
16
Hard-Coded Strings
16
Delphi:...................................................16
C++ Builder:.........................................17
Language Switching
17
Delphi:...................................................18
C++ Builder:.........................................18
18
Common Tasks.........................................................................................20
Checking Identifiers
24
25
Excluding Properties
25
Clearance Translations
25
TsiLangType Changing
25
Expert Options...............................................................................................................................................25
General Options
25
Strings in Source
26
FireMonkey Support......................................................................................................................... 38
External Tools..........................................................................................39
Dictionary Manager........................................................................................................................... 39
Dictionary Manager Automation Server.....................................................................................................40
SIL Editor........................................................................................................................................... 43
Displayed Properties
43
Fixed Languages
43
Automation Server.........................................................................................................................................44
Core Components............................................................................................................................. 49
TsiLang............................................................................................................................................................49
Properties
49
Methods
53
55
56
57
58
TsiLangLinked................................................................................................................................................58
TsiLangRT.......................................................................................................................................................59
Methods
59
Properties
60
TsiLangRTSE.................................................................................................................................................60
Methods
60
Properties
60
TsiLangTLV....................................................................................................................................................61
Properties
61
TsiLangDispatcher.........................................................................................................................................61
Methods
62
Properties
63
Events
64
Dialogs................................................................................................................................................. 65
Properties
65
Useful Information...................................................................................66
Delphi Sample
67
Delphi Sample
68
C++ Sample
68
Delphi Sample
70
Delphi Sample
70
Delphi Sample
71
Frequently Asked Questions............................................................................................................72
How to translate resource strings?...............................................................................................................72
I am using C++Builder. How do I translate string tables coded into .rc and .rh files?.......................72
Why some of my string constants dont appear in found strings form when translating sources?...72
How to translate TDBGrid columns?.........................................................................................................73
Copyright 1998-2014 Igor Siticov, SiComponents http://www.sicomponents.com
Version History.................................................................................................................................. 77
Version 7.1.1.........................................77
Version 7.1............................................77
Version 7.0............................................77
Version 6.5.5.........................................77
Version 6.5.4.........................................78
Version 6.5.3.........................................78
Version 6.5.2.........................................78
Version 6.5............................................79
Version 6.4............................................79
Version 6.3............................................80
version 6.2.............................................81
version 6.1.............................................81
version 6.0.3..........................................83
version 6.0.2..........................................83
version 6.0.1..........................................84
version 6.0.............................................85
version 5.3.2..........................................86
version 5.3.1..........................................86
version 5.3.0..........................................87
version 5.2.4..........................................88
version 5.2.3..........................................88
version 5.2.2..........................................88
Version 5.2............................................89
Version 5.1............................................89
Version 5.0............................................90
List of Tables...........................................................................................92
List of Figures..........................................................................................93
Index.........................................................................................................94
Developers Guide
Chapter
Introduction
Welcome!
The problem of globalization is sooner or later arising for all software companies and
developers, who intend to distribute their applications worldwide and wish to create
localized versions for the different foreign markets. Using the TsiLang Components Suite
for the applications developed in the framework of Borland Delphi, C+
+Builder, or Kylix is the best solution of the problem in many aspects.
TsiLang Components Suite includes a number of highly professional, easy-to-use VCL
components, wizards and tools for building multilingual applications. From the one
hand our product radically simplifies the entire process of globalization and from the
other hand it allows you to provide your customers with elegant, user-friendly
applications that can switch from one locale to another on-the-fly. Some TsiLang
Components Suite features that make its a distinguished product are the following:
Our suite brings you the opportunity to localize all that should be localized:
string-type properties of components, hard-coded string constants, resource
strings, system locales and standard dialogs strings, as well as other properties
that may affect on visual appearance of controls (for example, geometrical
sizes and positions of labels can be made different for each language when its
necessary).
You have the choice where to store the translation data: either internally
(ideally suits for lightweight applications single EXE file, no DLLs,
databases, etc.) or externally in special files (this approach allows to change
translations without recompiling the project so even your end-user may update
translations in the run-time).
Such essential tools as TsiLang Expert and Resource Strings Wizard included in
the suite help you to manage the translation process of you projects by simple
and convenient way. So, a large project might be prepared for the globalization
literally in a few minutes. The TsiLang Expert adds TsiLang components to the
projects forms and data modules, adjusts their properties, and scans the
project files for hard-coded strings. The Resource Strings Wizard allows you to
extract and add to translation data the resource strings of your project even
they are buried somewhere in a .dcu (.obj) without the source.
5
Developers Guide
A specialized tool shipped with the suite, namely the SIL Editor can be freely
redistributed and allows you to separate the translation process from the
project development.
And the Dictionary Manager helps to store common translations such as dialogs
captions and frequently used phrases that can be repeatedly used in many
projects. Also this tool serves as an automation server so its data can be easily
loaded by the SIL Editor or TsiLang property editors.
Since the first version release in 1998 the TsiLang Components Suite has been
continuously developing and improving, so today it represents a mature product with
the excellent ratio quality/price. The evidence of growing its popularity and customer
satisfaction are the readers choice awards Best Globalization Tool in 2004,
Runner-up Best Globalization Tool in 2003 and 2002 by the Delphi Informant
Magazine.
Contact Information
If you have any questions, suggestions to improve the Suite, or bug report feel
free to contact us via e-mail [email protected] or our web site http://
www.sicomponents.com/contacts.html. For the most current information and
updates of TsiLang Components Suite visit products web site:
http://www.tsilang.com.
Chapter
Getting Started
Installation
The TsiLang Components Suite consists of the following parts:
1. VCL (CLX) libraries containing all required components, property editors and
the TsiLang Expert. The trial version includes compiled packages and units
whereas the registered version all necessary source files (in case Full Source
license purchased) or compiled version of registered sources.
2. The SIL Editor is a convenient tool for editing translation data in external files.
This tool can be freely redistributed so you can separate the project
development and translation processes.
3. The Dictionary Manager is a standalone application for storing and managing
common translation databases. This program is widely used by other tools and
helps automate the translation process.
4. The Resource Strings Wizard - tool for importing resource strings from
executables.
5. The INI File Strings Wizard - tool for importing strings from INI File.
6. Demo Applications - a few sample projects that illustrate using the Suite.
7. Help Files.
Trial Version
On Windows:
Registered Version
E D I T I O N :
Once installation is completed you will find components installed into selected
IDEs. In case of any problems with automatic installation you may need to
install the packages into your IDE manually. From the IDE's menu select "File
| Open..." and choose an appropriate package:
TSiLang_Dn.dpk - in Delphi (n is IDE version)
TSiLang_CBn.bpk - in C++ Builder (n is IDE version)
+Builder version).
C L X
E D I T I O N :
If you have not chosen the option "Install CLX support" during the running
SISETUP.EXE, then launch the installation and follow the instructions (make sure the
box "Install CLX support" is checked). The extracted source files can be used on both
Windows and Linux platforms.
On Windows:
From the IDE's menu select "File | Open..." and choose an appropriate
package:
TSiLang_Dn_CLX.dpk - in Delphi (n is IDE version)
10
On Linux:
From the IDE's menu select "File | Open..." and choose an appropriate
package:
TSiLang_K1.dpk - in Kylix 1
TSiLang_K2.dpk - in Kylix 2
TSiLang_K3D.dpk - in Kylix 3 for Delphi
11
Components Review
In the base of the TsiLang Components Suite there are several classes built on VCL (CLX)
technology. These classes provide the storage for the applications data to be translated
as well the methods for managing those translations.
Main Components
These classes like many other ones are VCL (CLX) components and are being
registered in the IDE palette during the installation (by default on the SiComponents
page).
TsiCustomLang
Base class
TsiLang
Stores and manages translations (general component)
TsiLangRT
Provides run-time editing with built-in Translations Editor
TsiLangRTSE
The same as TsiLangRT, but uses SIL Editor application to edit translations.
TsiLangLinked
The same as TsiLang, but uses Dialogs and Locales translations externally
TsiLangTLV
Provides ability to handle TTreeView and TListView items.
The above figure represents the five main components that are derived from the
TsiCustomLang component. Hereinafter we will call all these types TsiLang if not
specified evidently. All these components have the ability to hold and handle the
following data:
12
Strings used in Standard Dialogs (only VCL Edition) and such functions as
MessageDlg, InputBox, and other.
All other non-string properties of VCL (CLX) components that may affect on
visual appearance of your application. For example, labels on a form might have
different positions and sizes for every supported language.
For the best results fonts and charsets might alter for different languages.
13
Form 1
TsiLang
Main Form
TsiLangDispatcher
Form 3
TsiLang
TsiLang
Form 2
TsiLang
All TsiLang components have LangDispatcher property that allow them to be linked
with a TsiLangDispatcher component placed on the main (or other auto-created)
form of the application. Using TsiLangDispatcher reduces the code necessary for
language switching in the whole application literally to a single line, like this:
...
procedure TForm1.ChangeLanguageClick(Sender: TObject);
begin
siLangDispatcher1.ActiveLanguage := TMenuItem(Sender).Tag;
end;
...
14
Tutorial
This tutorial takes you through the internationalization process of a sample application
with a few forms. In order to minimize the spade-work we suggest using the sample
MDI Application from the Delphi/C++ Builder repository (Select IDE menu File |
New | Other | Projects | MDI Application).
1. We should decide where to store translation data: either internally or
externally. For the most applications the best results are reached with
usual TsiLang components that do not require additional files and
provide fast language switching. So, place a TsiLang component on the
applications main form.
Which components
to use?
2. Our application has other two forms. Although we can also use TsiLang-type
components, it is often good practice to use TsiLangLinked components on the
secondary forms. The latter ones have no such properties as Dialogs or
Locales instead they retrieve the data from a common container (another
TsiLang component). Place a TsiLangLinked component on every secondary
form.
3. As our application has several forms so for the centralized management of
TsiLang components it is convenient to use a TsiLangDispatcher component.
Place a TsiLangDispatcher on the main form.
15
Setting properties
1. For the TsiLangLinked on the MDIChild in the Object Inspector set the
property LangDispatcher to the MainForms TsiLangDispatcher; and the
CommonContainer to the MainForms TsiLang component (unit Main
must be in uses clause of the current unit.
2. Repeat step 1 for the AboutBox form.
3. The LangDispatcher property of the MainForms TsiLang component also
set to the TsiLangDispatcher.
4. Now we must define supported languages. As all the TsiLang components are
linked to the TsiLangDispatcher, it is enough to adjust LangNames property
only for the dispatcher. Select the TsiLangDispatcher and in the Object
Inspector open LangNames property editor. Type names of desired languages
in arbitrary form, for example English, German, French. The number
and names of languages for the all linked TsiLang components will be
constituted automatically.
Using siDialogs
Usually a lot of strings are used immediately in the source code. In the MDI
Application a new MDI child window caption is determined by the following
code in Main.pas (main.cpp):
D E L P H I :
16
end;
C + +
B U I L D E R :
Such hard-coded strings as the above NONAME we shall also include to the
translation list. The easiest way to do it is to use the TsiLang Expert:
1. Launch the TsiLang Expert (from the IDEs menu select Tools | TsiLang
Expert.
2. From the Experts list of forms select the MainForm and choose from the
Experts menu File | Source | With Form
3. The above window shows all hard-coded strings found in the unit. Push the
Modify Source button to add NONAME to the translation list. All
occurrences of this string constant will be automatically replaced with a
respective TsiLang method call.
Language
Switching
17
2. Assign to their Tag properties values corresponding the language index (first
language has index 1). Make the menu items grouped and set AutoCheck
property to True.
3. Select all these menu items and create a common OnClick handler, for example
ChangeLanguage. In the event handler type the code:
D E L P H I :
B U I L D E R :
have made all required work as a software developer and now only
job is remaining! There are two ways to provide TsiLang
components with translation data:
T R A N S L A T I O N
E D I T O R
First, you can immediately enter and edit translation data in the IDE using the TsiLang
component editor (Translation Editor) or specialized property editors.
18
In order to launch the Translation Editor double click on a TsiLang component. As you
see all translations data are divided on several categories that are displayed in the leftpane tree view. You can also open this editor from the Object Inspector as a property
editor for the specified property (i.e. Captions, Hints, etc.). The Translation Editor has
many useful features and functions that will be considered later in the Section Using
Translation Editor.
S I L
E D I T O R
You can export all the current data (now it contains only default (English) strings) to
an external file and transfer this file along with the SIL Editor to a third-party translator.
The SIL Editor is a light-weight application and can be freely redistributed. It has the
convenient user interface and allows entering and editing translations. After the
translator returns the file you can import its data back to the project.
To export the project data to an external file launch the TsiLang Expert, from its
menu select File | Save/Load Translations | Save Project and save the file.
To import translation data from an external file launch the TsiLang Expert, from
its menu select File | Save/Load Translations | Load Project and select
the file.
19
Chapter
Common Tasks
Using TsiLang Expert
One of the most exciting tools of the TsiLang Components Suite is the TsiLang Expert, an
IDE add-in that dramatically facilitates the entire process of application
internationalization and carries out most of routine work. By default, the Expert is
installed into IDE under Tools menu.
When you launch the Expert it enumerates all forms in the active project and displays
their status in the list view. If a form has no TsiLang component you can quickly add a
TsiLang to this form via the Expert menu File | Translate or by double click on the
corresponding list view item.
To add TsiLang components to all project forms select all items in the list view and
choose from the Expert menu File | Translate or just press Enter key.
20
At the first step of the Wizard you need to specify what type of component to use for
each form for translations. The most recommended scheme to use is available for
preview by clicking the bottom link (highlighted in blue). After finishing selection of
components types click Next button to go to the next step of the Wizard.
On the second step of the Wizard (see picture below) you need to define languages
settings for selected forms and define which TsiLang to use as CommonContainer if
youve used any TsiLangLinked on selected forms.
To define languages settings you can either use TsiLangDispatcher on one from the
project forms or configure languages manually. The recommended way is to use
TsiLangDispatcher since this will dramatically simplify language switching and
management for your project.
21
If no form in the project holds TsiLangDispatcher you can create one by clicking
Create new button. If project already has a TsiLangDispatcher you can configure it by
clicking Configure button.
To set language settings manually for selected forms activate Set languages settings
manually options and edit languages by clicking Configure button near the option.
After clicking Next button the Wizard will provide you the details of the actions to be
performed and after your confirmation will configure your forms according to the
provided settings.
Search for Hard-Coded Strings
Besides string properties of components applications usually contain a lot of hardcoded strings that also need translation. The TsiLang Expert has an ability of scanning
your project in order to find and collect string constants. Selected string constants are
added to the Strings property of corresponding TsiLang component. When the active
language is changed all those strings are substituted with the respective translations.
There are four menu items related with translation of hard-coded strings:
22
The first two commands scan selected unit for strings used immediately in the source,
like this:
...
ShowMessage(Hello World!);
...
At that the first command treats the unit corresponding to the form selected in the list
view, and the second command does any unit of the project.
The second pair of commands is responsible for the treatment of strings declared
explicitly as constants, like this:
...
const
sHello = Hello World!;
...
ShowMessage(sHello);
...
Like the above pair the first command scans the selected form whereas the second one
does arbitrary unit.
If the Expert finds any strings in the selected unit the results are displayed in the below
dialog:
In the above dialog box you can delete strings that should not be translated (select rows
and press the Delete button) and change the start number for identifiers (Start ID
button). If some of the found strings should not be never translated (i.e. .txt), select
these strings and press Exclude button. Next time the Expert will ignore all
occurrences of .txt. If all the information is correct, press the Modify Source button
23
to add them to the translation data and to replace their occurrences in the unit with
TsiLang methods.
Working with External Files
The TsiLang Expert has the ability to export translation data of the whole project or
selected forms to external .SIL (.SIB) files that can be used for editing by third-party
translators, or distributed to your end-users which might wish to edit or modify them.
And vice-versa the Expert is able to update current translations through the import data
from external .SIL (.SIB) files.
Under File | Save/Load Translations there are the following commands:
Save form(s): Saves all translation information for the form(s) selected to an
external file.
Load form(s): Loads all translation information for the form(s) selected from an
external file.
Save project: Saves all translation information for all project forms to an external
file.
Load project: Loading all translation information for all project forms from an
external file.
Merge form(s): Merges all translation information for the form(s) selected from
an external file.
Merge project: Merges all translation information for all project forms from an
external file.
Other Functions
Checking
Identifiers
Under Expert Tools menu there are two commands Check Bad String IDs
and Check Bad String IDs in Unit(s) that search selected units for unused
string identifiers as well as check whether all used identifiers are included in the
translation data.
24
Any illegal or unused identifiers found by the Expert are displayed in the above dialog
box. Double click on a line to jump to the relevant place in the source code or
Translation Editor.
Search and
Replace
These features are accessible through the Expert menu Tools | Find
Phrase or Tools | Replace Phrase and allow finding and replacing any
words in the translation data of selected form(s).
Excluding
Properties
Clearance
Translations
The command Tools | Change TsiLang Type to allows quickly change one
TsiLang type to another on the selected form(s). It can be useful, for example, if
you decide to alternate data storage mechanism and change all TsiLang
components with TsiLangRT, without translation data losses.
TsiLangType
Changing
Expert Options
To adjust the Experts default settings to your needs select the command Tools |
Options The Expert Options dialog box is used to modify the following parameters:
General Options
settings.
Language Options: Specifies the default number, names and order of languages
for auto-created TsiLang components.
25
Strings in Source
Replacement Options:
Hard-coded strings: Default prefix defines the string to be used as prefix for
auto-generated string identifiers when replacing strings in sources.
Skip lines containing: Specifies the phrases that will cause skipping of the source
lines by Expert even if there is any string to translate. This option is useful if you
need to skip certain common source strings like assignment to TableName or
Database property of components.
Skip words and phrases: Specifies list of phrases that must be always skipped in
the source by the Expert. Additionally, you can activate Use Regular
Expression to skip phrases option and use Regular Expressions in this option
to specify set of phrases to skip.
26
Working with external .SIL or .SIB files (for example, you can save all
translation data into a .SIL file, transfer it to a third-party translator, and after file
is translated, load it back);
27
Find and insert a translation from the dictionary into the selected cell. The
choice is based on the languages that already have translations.
Get suggestion(s). Use this feature in case you can't find an exact translation.
TsiLang will analyze the dictionary and give you a list of suggestions according
to the sensitivity level you set: the lower the value, more suggestions you get.
Automatically translate the entire grid. The program will prompt you to select
the base language for translation.
When Dictionary Manager is active and you start editing of empty cell Translation
Editor will try automatically to find a translation for this cell from dictionary.
You can use the toolbars in the upper part of the window to access the most commonly
used actions.
Add or remove an item pressing Add or Delete button. Note that these
buttons are only available in the Strings section and for Extended Translations.
Use the "Tools | Languages" menu item to rename your project languages.
The "Tools | Default Fonts" menu item allows you to choose the default
Font and Charset for items that do not have a value assigned to their Font and/
or Charset properties.
Use the "Edit | Find" menu item to quickly locate a specific string in the grid.
Filter which translations you would like to see using the View | Display
menu. You can choose from: Translated - all translations for all languages are
done, Un-translated - only the base language string entered, Partially
Translated - you have more than one translation, but still have empty cells or
Incomplete- hides all translated items.
Use "Tools | Find in Source" to locate the first occurrence of selected string
ID in your source. Note this is available only while editing Strings section.
Some additional functions are available through a pop-up menu (right-click the
translation grid to pop-up):
28
Multiline - edit a cell in a pop-up dialog box. This gives you a more
comfortable way to edit a long multiline translation.
Translations Editor allows editing both general and extended translations. Please read
Using Extended Translations topic to learn the details of working with Extended
Translations property.
29
One can see that lengths of labels User name: and Benutzername are different so if
focused TEdit on the right hand form had the same width and position as one on the
left hand form the label would be overlapped. You can either redesign the form layout
or use ExtendedTranslations property of TsiLang component. Extended Translations
can be edited using Translations Editor. This includes components' non-string
properties, such as Left, Right, Width, Tag, Align etc. as well as all properties of any
sub-level components such as TLabeledEdit on Extended Translations tab. This could
be very useful, for instance, for repositioning or rescaling controls, when you translate
your application into a language with phrase length more than in original language.
Translating
To include a component's property into the list of translated properties:
30
1. Find the component in the Tree (left side of the window), expand the node
(pressing the 'plus' sign at the left of the node), then select the property to
be translated.
2.
Move the property to the Translations list (center of the window) clicking
in the menu Edit -> Add or selecting the appropriate popup-menu item.
3.
Select it in the Translations list and enter the translations into the cells for
every language in a manner you used to do in Delphi Object Inspector.
4.
It is very useful to use Update Translation in order to populate the values
for extended translations. To perform this just follow the next steps:
4.1.
Add components' properties that need to be translated into Extended
Translations.
4.2.
Close Translations Editor.
4.3.
Switch to another language by changing ActiveLanguage property of
TsiLang.
4.4.
Re-design your components as you would like to see them under this
language.
4.5.
Right-click on TsiLang and select Update Translations from appeared
popup-menu.
4.6.
As you will notice TsiLang will populate the values for selected
extended properties with current settings.
4.7.
Switching back and forth between languages will show you how your
design will look like under it.
To remove a property from the Translations: select it and click in menu Edit ->
Remove or select the appropriate popup-menu item.
31
LoadLanguageByExt
()
loads
ExtendedTranslations property from file.
specified
32
language
into
33
34
Properties to Exclude
This mode is used to exclude properties for all components by property name. Switch to
Properties to Exclude mode by clicking on Properties tab in the right side of the
window. To add particular property name to exclusion list select it in the properties tree
and click Add Property button. When adding property name like Caption, Hint or
others included into TsiLangs standard properties it will be displayed in red and bold
indicating that the respective list of TsiLang will be empty at all. To add all properties of
particular type click Add by Type command and specify property type to exclude. You
can also use just a part of the type name and Editor will add all properties with type
containing provided value. Use Add all <Type Name> Properties command to add
all properties with the same type as selected one. This could be useful, for example,
when it is needed to exclude all properties of Char type like PasswordChar and others.
35
Use Add by Name command to add all properties with the name containing the
specified value. All these commands are also available in the properties trees popupmenu.
You can also add some particular properties to Default list. Default list is stored and
can be used later for other forms and projects. Default list operations are available
through properties list popup-menu and Default toolbar buttons drop-down menu.
Use Add to Default List command to add selected property to Default list. To insert
some property from Default list use Insert from Default List command and select
needed property or use Insert All to insert all not yet included properties to the list.
Activate Auto-save Default List option available in Default menu to automatically
save Default list on any changing. Save Default List command saves Default list to
registry.
36
37
FireMonkey Support
TsiLang Components Suite version 7.0 introduced FireMonkey (all versions)
support.
Note: Please note the following while using TsiLang
components in FireMonkey projects:
Compiled units (DCU) are provided ONLY for Win32, Win64, Android
and OSX32 platforms. If you need to build your projects for other target
platforms you will need to re-build your project using sources of
TsiLang Components Suite units.
38
Chapter
External Tools
Dictionary Manager
39
You can use Dictionary Manager from TsiLang Translation Editor and SIL Editor.
To launch automatic translation of current cell click the
Button Auto Translate
translations to dictionary use
From the Dictionary Manager you can export dictionary content to the widely spread file
formats: (*.html, *.htm, *.xml, *.csv, *.doc, *.xls, or import the dictionary content from
the files of all above mentioned formats.
Export/Import features of the Dictionary Manager allow you to organize the work of
project translators in the best way making possible usage of convenient widely spread
word processors.
Nr
Interface
Description
1.
2.
3.
4.
40
Value
parameter
reserved.
is
Nr
Interface
Description
Clear(void) = 0; // [4]
5.
6.
7.
8.
9.
10.
11.
12.
41
42
SIL Editor
SIL Editor is a convenient tool for *.sil and *.sib files modification. The tool is
designated for convenient work of project translator, who is not obliged to install
Borland Delphi or C++ Builder with the only purpose of introducing translations into
the TsiLang component and as a consequence he/she is not obliged to pay license for
Borland software. Now translator can use only TsiLang files editor in order to work with
*.sil (*.sib) files exactly in the way it is done in TsiLang component editor.
When the translator finishes his work, he provides the software developer with the *.sil
(*.sib) file, containing project translation which can be loaded into the project using
TsiLang Expert. Standard text editor features are integrated here as well, such as cut,
copy and paste, find, replace, save, print, etc.
From the SIL Editor you can export translation information to widely spread file
formats: (*.html, *.htm, *.csv, *.doc, *.xls), or import the translation information from
the files of all above mentioned formats. Additionally, there is realized Merge Wizard,
so you can combine translations from several SIL/SIB files.
Displayed
Properties
In case you want to work with the selected properties rather than with all of
them, you can temporary suppress some properties in order not to be displayed
in the editor screen. When saving modified translations in the *.sil (*.sib) file all
hidden properties will be saved as well however.
In case you want to protect some columns from being occasionally modified
you can use Fixed languages option of SIL Editor. Columns, belonging to the
languages chosen will be displayed with no possibility for being modified.
Fixed Languages
43
Automation Server
Some SIL Editor methods can be accessed via COM interface. This possibility is
provided by SIL Editors COM server embedded into SIL Editor application. You can
import COM server type library using Projects | Import Type Library | SILEditor
from the main Borland C++Builder or Borland Delphi menu. The files
SILEditor_TLB.cpp and SILEditor_TLB.h will be included in your project. The
following SILEditor COM server's methods are available:
Table 2 Methods of SIL Editor Automation Server
Nr
Interface
Description
1.
2.
3.
is
Exports
translation
information
to
the
FileName with respect to
the format given by
ExportKind.
44
Value
parameter
reserved.
Value
parameter
reserved.
is
is
Nr
4.
5.
Interface
Description
} TExportType;
virtual HRESULT STDMETHODCALLTYPE
get_EditingFinished(
TOLEBOOL* Value/*[out,retval]*/) = 0;
// [4]
45
On the first step you need to select an executable that stores resource strings (if the
wizard is launched from TsiLang Expert it is already done).
Adjust available options to configure Wizards behavior.
46
On the second step you need to specify a unit with a TsiLang component that will hold
imported strings. After that you can translate those strings by the same way as other
hard-coded strings in TsiLang Translation Editor.
And at last, you select all resource strings that should be handled by a TsiLang
component. Most of them are never displayed so we recommend importing only really
needed strings. The source code of your application doesnt need any modifications.
47
48
Chapter
Components Reference
Core Components
The core components group includes the following components:
TsiCustomLang Descendants:
o TsiLang
o TsiLangLinked
o TsiLangRT
o TsiLangRTSE (VCL Edition only)
o TsiLangTLV
TsiLangDispatcher
Below you will find a comprehensive list of the above components properties, methods,
and events.
TsiLang
Most of properties and methods for all TsiLang types are implemented in the base class
TsiCustomLang and therefore are common. The TsiLang has no additional properties
or methods in comparison to the TsiCustomLang but only publishes the relevant ones.
The TsiLang (TsiCustomLang) properties can be grouped as follows:
Properties
Data Type
Description
Captions
TStrings
DisplayLabels
TStrings
49
Property Name
Data Type
Description
ExtendedTranslation
s
TsiExtendedItem
s
Hints
TStrings
Strings
TStrings
Fonts
TStrings
Charsets
TStrings
Multilines
TStrings
DlgsCaptions
TStrings
OtherStrings
TStrings
Locales
TStrings
Collections
TStrings
Data
Type
Description
ActiveLanguage
Integer
AutoSkipEmpties
Boolean
50
Property Name
Data
Type
Description
ChangeLocales
Boolean
DefaultLanguage
Integer
DoNotTranslate
TStrings
ExcludedProperties
TStrings
HandleResourceStrings
Boolean
LangNames
TStrings
Language
String
NumOfLanguages
Integer
SmartExcludeProps
TStrings
TranslateExtendedFirst
Boolean
UseDefaultLanguage
Boolean
51
Data Type
Description
ChangingCursor
TCursor
DoRaiseExceptions
Boolean
IsInheritedOwner
Boolean
LangDelim
Byte
LangDispatcher
TsiLangDispatcher
NeedAllDlgs
Boolean
52
Property Name
Data Type
Description
Options
TsiLangOption;
TsiLangOption =
(loUseExtUDStrings,
loUseExtCommonStrings);
TranslateType
TTranslateType;
TTranslateType =
(ttNoChange, ttGetDefault);
Methods
AddString method adds string constants AStrings to Strings property with ID equal
to TextID. This method can be used for existing constants editing. The method
replaces old constants with new ones in the case if TextID is the same. Returns True
if method finished successfully otherwise False.
function DeleteString(TextID: string): boolean;
DeleteString method removes constants with ID equal to TextID. Returns True if
method finished successfully otherwise False.
procedure ReplaceStringValue(AStrings: pStrings; Value,
AName: string; ALang: integer); virtual;
ReplaceStringValue method is used for run-time translations replacement.
AStrings: pointer to TsiLang TStrings property. For ex. "@siLang1.Captions".
Value: string value that should be placed into the translations list.
AName: string identifier of the translation. For instance, for the following properties
such as Captions, Hints, etc. this value represents the name of the component that
53
should be translated.
ALang: language number the Value (translation) is associated with.
function GetText(const TextID: string): string;
GetText method returns string constant by TextID depending on ActiveLanguage
property.
TextID:
string;
const
GetTextByInt is so, that the later uses an integer value as an input parameter. Integer
IDs for "Strings" property should be introduced prior to method invocation.
Methods to work
with SIL files
LoadFromFile method loads property defined by PropType from the file named
AFileName. In the case if CanRewrite is set to True then the translation information
stored in PropType property will be removed. Otherwise, if CanRewrite is set to
False then the translation information stored in the file AFileName will be added to
the end of the translation list. With CanRewrite set to True you should not
obligatory delete all previous translation information if you want to use new
translations. Otherwise (when CanRewrite is set to False) you should be aware of the
fact that if there are several translation strings for the component with the same
name (for ex. "Label1"), then the first translation string found will be used for the
following translation. If you want to avoid this situation you should delete old
translation information prior to LoadFromFile invocation.
procedure LoadAllFromFile(AFileName: string; CanRewrite:
boolean);
LoadAllFromFile method loads all TsiLang properties (Captions, Hints, Font etc.)
from the file named AFileName and if CanRewrite is set to True then all translation
information will be removed before loading translations from file.
function SaveStringsToFile(AFileName: string; Delimiter:
char): integer;
SaveAllToFile method saves all TsiLang properties (like Captions, Hints, Fonts and
etc.) in the file named AFileName and uses delimiter defined by Delimiter in order
to separate strings in different languages.
55
MergeFromFile method merges the translation information stored in the file named
AFileName to the property defined by PropType.
Method reads string translations from the file and adds them to the end of the
respective list in the PropType property. In the case if the file AFileName does not
contain the complete set of translations for any of the components, then missing
information is taken from TsiLang.
The return value is set to True if merging was done successfully; otherwise it is set to
False.
function MergeAllFromFile(AFileName: string): boolean;
MergeAllFromFile method executes MergeFromFile method for all TsiLang
properties (Captions, Hints, Font etc.) from the file named AFileName. The return
value is set to True if merging was done successfully otherwise it is set to False.
procedure LoadAllFromFileDNC(AFileName: string; CanRewrite:
boolean);
procedure LoadPropFromBinaryFile(PropType:
TStringsType; const FileName: string);
56
57
function
MessageDlgPos(const
Msg:
string;
DlgType:
TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y:
Integer;
const
DefaultBtn:
TMsgDlgBtn
=
mbOK;
const
CancelBtn: TMsgDlgBtn = mbCancel): Integer;
function
MessageDlgPosHelp(const
Msg:
string;
DlgType:
TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y:
Integer; const HelpFileName: string; const DefaultBtn:
TMsgDlgBtn = mbOK; const CancelBtn: TMsgDlgBtn = mbCancel):
Integer;
Other methods
procedure
MoveLanguage(const
FromIndex,
ToIndex:
Integer);
InsertLanguage(const
ALanguage: string);
Index:
Integer;
const
GetLanguageNamesFromFile(const
const LanguageList: TStrings);
FileName:
string;
Gets available language names in SIL or SIB file into LanguageList list.
TsiLangLinked
In order to achieve better performance and to reduce memory usage as well as the size
of application file it is better to use TsiLangLinked component. It is linked with the
existing TsiLang component and shares with it the translation information that is
potentially common for the several forms in your application (see the scheme below).
The difference between TsiLang and TsiLangLinked is that the properties
DlgsCaptions and Locales are run-time only in TsiLangLinked while they are
design-time properties in TsiLang class.
Table 6 TsiLangLinked specific properties
58
Property Name
Data Type
Description
CommonContainer
TsiCustom
Lang
TsiLangRT
You know already that it is enough to use TsiLang in order to internationalize your
application, but to do this you must involve a person who knows well the foreign
language your project is translated to. Sometimes it is difficult or inconvenient to do and
in this case you can delegate the translation of your project to your end-level user. This is
possible to perform using TsiLangRT (TsiLang Run-Time). For allowing end-user to
translate text strings from your form you must use EditAll() method. Unit siLangRT
contains two global variables that could be used for providing your end-user the
localized version of Translations Editor:
RT_SILFile- Translations Editor will load its translations from this SIL file if defined
and points to existing SIL file. The initial SIL file for Translations Editor is included
into standard delivery set and called RT.SIL. So you can translate this file and ship it
with your application in order to provide your end-users with localized version of builtin editor.
RT_ActiveLanguage- Translations Editor will switch to this language if applicable
on activation.
Methods
This method calls built-in property editor, providing end-user with the possibility to
translate text strings by him. You must only take care about the appropriate
internationalization user interface in your application.
function EditAll: Boolean;
Also you might try to use EditAll method to perform editing of all translation
properties at once. To translate ExtendedTranslations property you should use
EditExtended method.
function EditExtended: Boolean;
All methods above return True when user saved translations on close and False when
user decided to cancel changes.
59
Properties
Data Type
Description
LoadOnCreate
Bool
StorageDelimiter
String
StorageFile
TFileName
TsiLangRTSE
TsiLang RTSE component is very similar to TsiLangRT. The difference is in the editor
that is used for translation information modification and in the way of its invocation.
TsiLangRT uses built-in translation editor, whereas TsiLangRTSE uses SIL Editor stand-alone application and automation server. While using TsiLangRTSE your
application is communicating with SILEditor via the COM interface.
TsiLangRTSE EditStrings method is used instead of EditProperty method
(TsiLangRT) in order to invoke automation server (embedded in SIL Editor) for
translation information modification. :
Methods
EditStrings method saves all translation stored in itself into SILFile, then
activates automation server object embedded in SIL Editor application for
translating it and after that loads translation information from the file named
SILFile. The DefPropty indicates which property will be activated in SIL Editor
by default. The FDelim parameter indicates the delimiter that will be used for
saving translation in the file.
Properties
60
Property Name
Data Type
Description
LoadOnCreate
Bool
SILEditor
string
SILFile
TFileName
TsiLangTLV
TsiLangTLV component is an enhanced version of TsiLang component, which
provides you with the possibility of TTreeView and TListView items translation.
Since TTreeView.Items and TListView.Items are objects, derived from TObject, they
are not supported by RTTI system and TsiLangTLV cannot trace Items modification
such as Items removal and other changes in Items structure. Thus, you can use this
component properly only if you are sure that contents of your TTreeView and
TListView will not be changed at run-time. For editing translation just edit
"ListView_TreeView_Items" property of TsiLangTLV in the same manner as all other
properties of TsiCustomLang descendants.
Properties
Data
Type
Description
ListView_TreeView_Items
TStrings
TsiLangDispatcher
In the case, when your application contains more than one form, you need to use more
than one TsiLang component, because TsiLang component is aware of text strings to be
translated only within the form it is placed at. Thus, each form in your project needs in
one TsiLang component, i.e. the number of TsiLang components in your project should
be equal to the number of forms to be translated in it. When the number of forms is big
enough then it is rather complicated to manipulate and manage all the TsiLangs
manually. For instance, when you have 12 forms, you should write 12 lines of the above
code in order to change an active language for all forms.
61
In order not to do it manually and in order not to keep in mind all your TsiLangs with
their properties, you can delegate TsiLangs management process to the
TsiLangDispatcher component.
The way of TsiLangDispatcher using is very simple. You must do the following:
62
Properties
Property Name
Data Type
Description
ActiveLanguage
Integer
Range: [1-NumOfLanguages].
Automatically sets ActiveLanguage property of all
TsiLangcomponents, connected with
TsiLangDispatcher
NumOfLanguages
Integer
LangNames
TStrings
Language
String
Filename
String
SiLangsCount
Integer
SiLangs[Index:
Integer]
TsiCustomLang
TestModeInfo
TTestModeInfo
DefaultLanguage
Integer
63
Property Name
Data Type
Description
UseDefaultLanguag
e
Boolean
Events
Property Name
Data Type
Description
Active
Boolean
Kind
TTestModeKin
d
ExpandWidthPercent
Integer
ExpandCharsPercent
Integer
PaddingChar
Char
Type
Description
OnLinkToDispatche
r
procedure(Sender
: TObject;
ASiLang:
TsiCustomLang)
64
Dialogs
Dialogs are often used components in your application and they are very important for
convenient and habitual user interface. It is evident, that powerful multilingual tools,
such as TsiLang must provide user with the possibility of translating dialog text
elements. TsiLang provide you with such a possibility and contains dialog elements
translation information in its DlgsCaptions property, but it cannot translate standard
dialogs directly because all standard dialogs do not publish their text elements as a set of
properties. Issuing a new set of dialog components with included multilingual support
solves the problem. The following dialog components are included into the TsiLang
Component Suite (VCL Edition):
TsiOpenDialog
TsiSaveDialog
TsiColorDialog
TsiFontDialog
TsiPrinterSetupDialog
TsiPrintDialog
TsiFindDialog
TsiReplaceDialog
TsiOpenPictureDialog
TsiSavePictureDialog
TsiBrowseForFolder
Properties
Property Name
Data Type
Description
siLang
TsiCustomLang
65
Chapter
Useful Information
If you have any questions about usage the TsiLang Components Suite feel free to send
us e-mail on [email protected]. Also you can visit our Forum at
http://www.sicomponents.com/forum/ where you can share experience with other
TsiLang customers and find answers on many questions.
66
FieldName,
coded string.
{TSI:IGNORE ON} indicates that all lines after this line should be skipped when
searching for hard-coded strings. All lines will be skipped till OFF tag found. Note: this
tag should be in separate line and there should be no any other text in this line.
{TSI:IGNORE OFF} indicates to stop skipping lines when searching for hard-coded
strings. Note: this tag should be in separate line and there should be no any other text in
this line.
{TSI:IGNORE NEXT} excludes one following line of code from the translation
regardless of {TSI:IGNORE ON/OFF}.
{TSI:TRANSLATE NEXT} translates one following line of code from regardless of
{TSI:IGNORE ON/OFF}.
Delphi Sample
67
initialization
InitTntEnvironment;
MsgDlgFormClass := TTntForm;
MsgDlgLabelClass := TTntLabel;
MsgDlgEditClass := TTntEdit;
MsgDlgButtonClass := TTntButton;
C++ Sample
MsgDlgFormClass = __classid(TTntForm);
MsgDlgLabelClass = __classid(TTntLabel);
MsgDlgEditClass = __classid(TTntEdit);
MsgDlgButtonClass = __classid(TTntButton);
68
After youve set Default Fonts you can set Auto-Use Default Fonts option in
TsiLang Translation Editor (menu Tools | Settings) and Translation Editor will
automatically fill Fonts and Charsets sections using data from Default Fonts (if
available).
TsiLang will call this procedure if it is assigned and this will allow you to perform custom
modifications on the string being applied on controls property. AObject parameter
indicates the object (or component) whose property will be modified to APropValue
value. Property could be determined by PInfo parameter of a PPropInfo type.
PPropInfo type is declared in TypInfo Delphis unit.
69
Delphi Sample
var
WS: WideString;
S: string;
begin
if AObject is TControl then // checking
begin
if PInfo.Name = 'UTF8Caption' then
property
begin
WS := AnsiStringToWideStringCP(APropValue,
YOURFORM.siLang1.CurrentCharset); // convert ANSI string
Unicode
from TsiLang to
to
control's property
end;
end;
end;
initialization
siInterceptStringChange := ConvertToUTF8;
// Assign procedure
variable
70
Delphi Sample
6. If you decide to use it built-in into your application then just create RC-file (you
can use our Resource Builder http://www.resource-builder.com) and place this
SIB file as RCDATA resource. Load this translation using TResourceStream
and LoadFromStream() method of TsiLang:
7. Thats all, now when this dialog appears it will be automatically translated.
Note: Example code provided above are for reference only! For
your particular case it could be different.
71
constname =
72
'stringvariable';
constname = 'stringvariable';
You need to replace the StrArr declaration with the following one:
StrArr: array[0..2] of PString = (@str1, @str2, @str3);
73
However, those TActionClientItems that not linked with any action, for example toplevel items of TActionMainMenuBar, have no published string properties and cannot be
handled directly. For such TActionClientItems we would recommend the following
trick:
1. For every TActionClientItem without a TAction create a "fake" Action and link
them. For example, if your TActionMainMenuBar has a top-level menu item
'&File', create a new action FileFile1, set its .Caption property to '&File', and link
them.
2. Enter translation data for this Action in the Translation Editor.
3. If an action has no event handler it is permanently disabled, so set the
OnUpdate event handler of all "fake" actions to a procedure like this:
...
procedure TForm1.FakeActionUpdate(Sender: TObject);
begin
TAction(Sender).Enabled := True;
end;
...
Yes, although it requires some tricks. Find the details at our forum at
http://www.sicomponents.com/forum/viewtopic.php?t=112
Why TDBNavigator hints are not translated at start-up?
There is small bug (or as designed) in TDBNavigator component. To fix it you may
use the following sample code:
procedure TForm1.FormCreate(Sender: TObject);
begin
DBNavigator1.Hints.CommaText :=
siLang1.GetStringValue(@siLang1.MultiLines,
'DBNavigator1.Hints', siLang1.ActiveLanguage);
end;
75
var
LangID: DWORD;
begin
LangID := GetUserDefaultLangID;
case Byte(LangID and $03FF) of
LANG_ENGLISH: siLangDispatcher1.ActiveLanguage := 1;
LANG_GERMAN: siLangDispatcher1.ActiveLanguage := 2;
LANG_FRENCH: siLangDispatcher1.ActiveLanguage := 3;
else
siLangDispatcher1.ActiveLanguage := 1;
end;
76
Version History
The history of new features added and improvements in the last versions of TsiLang
Components Suite is listed below.
V E R S I O N
7 . 1 . 1
Core components:
Fixed problem with language changing on fly under Android.
Support for Embarcadero RAD Studio XE 5 Update 2.
V E R S I O N
7 . 1
Core components:
Support for Embarcadero RAD Studio XE 5.
Support for Android and iOS target platforms.
Fixed problem with local characters corruption in units sources when translating
CONST section.
Other minor fixes and improvements.
SIL Editor:
Minor fixes and improvements.
V E R S I O N
7 . 0
Core components:
Support for Embarcadero RAD Studio XE 4.
FireMonkey all versions support. Please add FMX global conditional define in
your FireMonkey projects that use TsiLang. Please see FireMonkey Support topic
for details.
Fixed problem with Unicode conversions under Windows Embedded.
Other minor fixes and improvements.
SIL Editor:
Fixed bugs on SIL <-> SIB conversions.
Fixed problem with Update Manager.
Other minor fixes and improvements.
Dictionary Manager:
Fixed several bugs.
Other minor improvements.
V E R S I O N
6 . 5 . 5
Core components:
Support for Embarcadero RAD Studio XE 3 (Win32 and Win64 applications).
Other minor fixes and improvements.
77
SIL Editor:
New UI design
Dictionary Manager:
New UI design
Support for TMX (Translation Memory Exchange) files.
V E R S I O N
6 . 5 . 4
Core components:
Support for Embarcadero RAD Studio XE 2 (Win32 and Win64 applications).
Few minor fixes and improvements.
V E R S I O N
6 . 5 . 3
Core components:
Fixed: bug with Unicode strings for Windows Dialogs controls under Delphi
2009+.
Other minor fixes and improvements.
Translation Editor:
Added information about item length in chars to translation widths tool-tip
window.
TsiLang Expert
Added an option to prevent insertion of comments with initial string when
translating source code.
Fixed: TsiLang Expert won't start when only a package project opened in IDE.
SIL Editor:
New feature: Highlight multi-line items with different number of lines in
translations.
Improved SIL file validation speed.
Fixed: bug with navigation when using global search in SIB files.
Improved sorting by String ID column.
Improved Update Manager.
Fixed: exporting to another format has used the incorrect header value.
Fixed: Locales section not imported when importing from XML.
Dictionary Manager:
Improved Update Manager
V E R S I O N
6 . 5 . 2
Core components:
Support for Embarcadero RAD Studio XE
Fixed: bug with UTF-8 and dialog buttons captions.
78
6 . 5
Core components:
Embarcadero RAD Studio 2010 support!
Small fixes and improvements.
TsiLang Expert:
Fixed problem with Unicode preview in Skipped Strings window.
Other minor fixes and improvements.
SIL Editor:
Fixed several problems and few improvements made.
Updated German translation.
Dictionary Manager:
Fixed several problems and few improvements made.
Updated German translation.
V E R S I O N
6 . 4
Core components:
OnLanguageChanging event. New event designed, which will be fired before
language changing.
Feature: exclude property of particular component class. This will allow you to
exclude the specified property for all components of the particular class.
Fixed bug with loading SIB and IsInheritedOwner=true.
Fixed: StoreAsUTF8 and Delphi 2009 conflicts.
siLang_Def_UsedInCpp global variable to provide ability to handle properly
escape sequences under C++Builder projects for BDS2006 and later.
Several other improvements and some bug fixes applied.
Translation Editor:
Support for Project Translation Settings.
Close button on tool-bar changes to Close Saved when there were made any
changes to translations.
Improved pasting of text range from clipboard.
Small fixes and tweaks.
79
TsiLang Expert:
Project Translation Settings. This will allow you to define Dictionary and
translation related settings for your projects. TsiLang Expert and Translation
Editor will use them when working with Dictionary and other wizards.
Found Strings improved: added Ignore button on tool-bar.
Improved speed and algorithm of source scanning.
Fixed bug: ID wasn't renamed in TsiLang after it was renamed in the grid of the
found strings form.
Fixed Index Out of Bounds error, which appears occasionally for some units under
Delphi(BCB) 6 and earlier.
Fixed AV errors upon exit from Delphi(BCB)6 and earlier.
Other minor fixes and improvements.
SIL Editor:
Copy Language feature. Now you can copy one language to another with couple
of mouse clicks.
String ID column is selectable now, which allows to copy IDs as well.
Improved pasting of text range from clipboard.
Fonts combo-box allows to enter custom font name, like Ms Shell Dlg 2.
Add language to Dictionary. New feature allows you to add only the selected
language to Dictionary.
Fixed: command-line merge of SIL files didn't add new language from merged file.
Fixed problem with entering Japanese characters.
Hungarian language for user interface.
Other small improvements and fixes.
Dictionary Manager:
Multilanguage Support! Dictionary Manager now multilingual as well as SIL
Editor.
Fixed: Add All to Dictionary incorrectly places item.
V E R S I O N
6 . 3
Core components:
CodeGear RAD Studio 2009 support!
Single packages for Delphi and C++Builder!
TaskMessageDlg support in TsiLang message box methods.
Better support for actions linked to components.
SIL files load speed improved.
Titles of Print, Print Setup, Find, Replace and Color dialogs and Network button in
Print Setup dialog now supported and translated by TsiLang.
UTF-8 support for internal translations storage.
CTRL+C support in message dialogs.
Exclude component item now available in design-time component's popupmenu.
A lot of improvements and some bug fixes applied.
Translation Editor:
Translations Comments support.
Remove duplicates functionality.
Smart auto-translate of multi-line text with dictionary.
Sorting by string ID improved.
80
TsiLang Expert:
Translation Wizard now able to configure additional properties.
User Interface for some dialogs improved to be nicely displayed under Windows
VISTA.
Source scanning for hard-coded strings and strings in CONST section was
dramatically improved and now it will handle most of the declarations used.
Found strings form improved in order to provide better preview of source code
where string constant is used.
Several improvements implemented into other TsiLang Expert functions.
SIL Editor:
Translations Comments.
Fully Unicode!
UTF-8 support for SIL and SIB files.
XML support.
Auto-initialize Fonts and Charsets for languages.
Command-line support for SIB files auto-translation.
Display of leading and trailing spaces.
Dictionary Manager:
DIX (XML) dictionaries!
Custom auto-translate services
V E R S I O N
6 . 2
V E R S I O N
6 . 1
81
82
V E R S I O N
6 . 0 . 3
V E R S I O N
6 . 0 . 2
TNT Controls and LMD ElPack support componentscreated new components (analogues for all existing TsiLang components)
which add support for Unicode TWideStrings and other specific properties
of TNT Controls and LMD ElPack controls.
Improved and fixed bug with file loading. SIB loading is even faster now.
Improved speed of reading translations for inherited forms.
Improved source parsing in TsiLang Expert.
SIL Editor:
Pseudo Translation Wizard- SIL Editor now provides you the wizard
that will allow to generate pseudo translations for your items in order to be
83
able to test the appearance of you applications for different languages with
non-English letters and umlauts, like German, French, East Europe and
others.
Delete form from SIB file- it is possible to delete forms directly from SIB
file using SIL Editor .
Command-line merging for files- it is possible to use command-line
switches to perform merging of different files. To merge files using
command-line please use the following switches:
V E R S I O N
6 . 0 . 1
SIL Editor:
84
V E R S I O N
6 . 0
o Statistics Wizard- SIL Editor now provides you the statistics so you
can count how many words and items to translate and other
information.
o Encryption and Decryption- SIL Editor provides ability to encrypt
string IDs, in order to "hide" application structure. Also added
option to hide first column.
o Some internal improvements.
Some minor bugs and improvements.
85
Translation Wizard allows translating selected form(s) with stepby-step detailed instructions and help as well as configures already
translated forms.
o Some internal improvements.
Dictionary Manager:
o Improved XML import Wizard
o Added ability to delete multiple selected rows at once.
o Added ability to delete any language (previously only the last one
could be deleted).
o Fixed some bugs and implemented other minor improvements.
SIL Editor:
o
Multilanguage interface- SIL Editor now supports multilanguage
interface and you can easily translate it into your own language.
o Some internal improvements.
o
V E R S I O N
V E R S I O N
5 . 3 . 2
5 . 3 . 1
86
V E R S I O N
5 . 3 . 0
87
V E R S I O N
V E R S I O N
V E R S I O N
5 . 2 . 4
Various improvements and optimizations are implemented in the VCL, SIL File
Editor, and Dictionary Manager.
5 . 2 . 3
TsiLang Files Editor: exporting .sil-files to .sib format and vice versa.
Dictionary Manager is Unicode: The Dictionary Manager is redesigned for Unicode support. Now under Windows NT/2k/XP
you can simultaneously edit translations in any language.
5 . 2 . 2
88
V E R S I O N
5 . 2
Other Improvements:
o Number of optimizations is made to make the library smaller and faster.
o User interface of the Translation Editor is changed so that design-time
property editors, run-time Translation Editor and SIL Editor have
consistent feel and look.
o Multiple cells selection in the Translation Editor is implemented (for
Copy/Cut/Paste/Delete treatment).
o Ignore/Check Removals command is added for TsiLang component
editor. This is useful when you move controls on your form via Cut>Paste in design-time. It is good idea before cutting a control to set
"Ignore removals" flag for the TsiLang component, so that any
references to this control would not lost in the TsiLang properties.
o The new method "ClearTranslations" is introduced for TsiLang
components and corresponding command is added to the TsiLang
Expert. This removes all translation data from the component.
V E R S I O N
5 . 1
VCL and CLX Editions: For the best support of CLX technology TsiLang
Components Suite is divided into two editions: VCL and CLX. The latter one
allows you to create true CLX Multilanguage applications under Windows with
Delphi 6 and C++Builder 6 as well as under Linux with Kylix 1 and 2.
89
component and allows loading and saving translations at run-time a few times
faster than from/to .SIL files.
Other Improvements:
o Checking for duplicate ID when adding new ID in Strings Editor.
o Renaming ID in sources when changing it in Strings Editor.
o Possibility to exclude blank values in Translation Editor.
o Suggest translation feature.
o Default language names.
o TsiLang Files Editor (SIL Editor): Support for binary .SIB files;
Redesigned user's interface; Suggest translation feature; Improved
export/import;
o Dictionary Manager: Spell checking; Improved export/import;
V E R S I O N
5 . 0
Improvement: components with ParentFont property set to True are not longer
listed in the Fonts and Charsets properties.
TsiLang Expert Improvement: TsiLang Expert will now suggest smarter string
identifiers under Source Translation feature.
90
SIL Editor Improvement: Translation Info tips - when entering a cell an info tip
displaying values from all the languages pops up. This is very useful when there
is not enough room to display all columns.
SIL Editor Improvement: Columns can now be sorted both ascending and
descending.
91
List of Tables
Table 1 Dictionary Manager Automation Server....................................40
Table 2 Methods of SIL Editor Automation Server.................................44
Table 3 TsiLang translation-aware properties.......................................49
Table 4 TsiLang behavior-aware properties...........................................50
Table 5 Other properties of TsiLang.......................................................52
Table 6 TsiLangLinked specific properties............................................58
Table 7 TsiLangRT specific properties...................................................60
Table 8 TsiLangRTSE specific properties..............................................60
Table 9 TsiLangTLV specific properties.................................................61
Table 10 TsiLangDispatcher properties..................................................63
Table 11 TTestModeInfo fields................................................................64
Table 12 TsiLangDispatcher events.......................................................64
Table 13 siDialogs specific properties...................................................65
92
List of Figures
Figure 1 Core components hierarchy......................................................12
Figure 2 Multiple TsiLang components are linked to a single
TsiLangDispatcher...................................................................................14
Figure 3 Forms with a TsiLangDispatcher and TsiLang components. . .15
Figure 4 Strings constants found by the Expert.....................................17
Figure 5 Menu items for language switching.........................................17
Figure 6 Translation Editor displays translation-aware properties....19
Figure 7 TsiLang Expert..........................................................................20
Figure 8 Translations Wizard (First step)...............................................21
Figure 9 Translations Wizard (Second Step)..........................................22
Figure 10 Hard-coded strings found by the Expert.................................23
Figure 11 Bad string identifiers found by the Expert.............................25
Figure 12 Translations Editor..................................................................27
Figure 13 Extended Translations property editor..................................30
Figure 14 Exclude components from translations.................................35
Figure 15 Exclude properties from translations.....................................36
Figure 16 Exclude components properties from translations...............37
Figure 17 Dictionary Manager.................................................................39
Figure 18 SIL Editor.................................................................................43
Figure 19 Resource Strings Wizard - Step 1...........................................46
Figure 20 Resource Strings Wizard - Step 2...........................................47
Figure 21 Resource Strings Wizard - Step 3...........................................47
Figure 22 Configuring Default Fonts.......................................................69
93
Index
Contacting Information.......................................8
Dialogs 64
Dictionary Manager...........................................38
ExtendedTranslations.................................49, 55
ExtendedTranslations...........................................
Using........................................................30, 32
GetText 26, 53
GetTextOrDefault........................................26, 53
Hard-coded strings................................................
Prefix.............................................................26
Search............................................................22
Installation..........................................................9
Registered Version........................................10
Trial Version....................................................9
Language switching..........................................17
Resource strings...................................................
Importing.......................................................45
SIL Editor...........................................................42
TsiCustomLang...........................................12, 58
TsiLang 9, 10, 16, 18, 26, 48, 61, 62
TsiLang
Properties......................................................48
Review...........................................................12
TsiLang Expert......................................................
Using..............................................................20
TsiLangDispatcher............................................60
TsiLangDispatcher................................................
Review...........................................................13
TsiLangLinked...................................................57
Properties......................................................57
TsiLangRT.........................................................58
Methods.........................................................58
Properties......................................................59
TsiLangRTSE.....................................................59
Methods.........................................................59
Properties......................................................59
TsiLangTLV.......................................................60
94