For translating database grids just add all fields to the respective data-set and use TsiLang “DisplayLabels” property to translate display label for each field. In the grid “Columns” property do not set “Title” sub-property it will be overwritten by field’s “DisplayLabel” property. Or you can translate them using Collections property of TsiLang.
Just use the same technique as for CONST section and change keyword RESOURCESTRING to CONST.
The following declaration of string constant:
const
constname =
'stringvariable';
should be changed to:
const
constname = 'stringvariable';For translating InfoPower’s DBGrid component: just use the “Multilines” property of TsiLang and translate the grid’s “Selected” property.
Note: Be careful with this property translation, be sure to keep the format and places of the tabulation TAB character.
Just use the TsiLangs ExtendedTranslations property. This property will help you to translate any other property not handled by TsiLang directly.
You can insert into the source the following tags: {TSI:IGNORE}, {TSI:IGNORE ON},{TSI:IGNORE OFF}, {TSI:IGNORE NEXT} and {TSI:IGNORE VALUE} to inform TsiLang Expert that these lines or code blocks should be skipped for translation. Please check the User Guide and help file for the detailed description of these tags.
Just use the respective methods of TsiLang components. All standard dialog box functions like MessageDlg(), ShowMessage(), InputBox() are re-implemented in TsiLang to provide internationalization support.
This could happen only of if you use older versions of the OS and IDE. You might need to install Japanese (or any other non-Western) locale support and/or set your system’s default locale to Japanese. To do that go to Control Panel|Regional Options|General tab. Make sure the check box related to your locale is checked, then hit the Set Default button to set the related locale as system’s default.
Also please check the following article: https://www.tsilang.com/support-for-unicode-languages/
We recommend the following workaround:
externPACKAGE AnsiString__fastcallLoadStr2(intIdent) { TResStringRec ResRec; ResRec.module = (long*) &HInstance; ResRec.ident = Ident;return(LoadResString(&ResRec)); }
Compile your application.
Run TsiLang Resource Strings Import Wizard (available from TsiLang Expert’s Tools|Wizards menu) and import all strings from your executable that need to be translated.
All these strings (selected in wizard) will be imported into TsiLang and will be available for translation.
Enter the translations for these strings and re-build the project.
Usually every TActionClientItem is linked to a corresponding TAction which provides string data for its clients. TsiLang components maintain Action’s string properties such as Caption or Hint, so all visual controls linked to the Action are updated when the active language is changed.
However, those TActionClientItems that are not linked with any action, for example top-level items of TActionMainMenuBar, have no published string properties and cannot be handled directly. For such TActionClientItems we would recommend the following trick:
procedure TForm1.FakeActionUpdate(Sender: TObject);
begin
TAction(Sender).Enabled := True;
end;
A demo project for this case could be downloaded from https://www.sicomponents.com/soft/ActionManager.zip
If you are using data structures like the below:
const str1 = 'My String constant 1'; str2 = 'My String constant 2'; str3 = 'My String constant 3'; StrArr: array[0..2] of string = (str1, str2, str3);
You need to replace the StrArr declaration with the following one:
StrArr: array[0..2] of PString = (@str1, @str2, @str3);
Also, all the references in the code to the array’s elements like
...StrArr[Index]...
must be replaced with:
...StrArr[Index]^...
Unfortunately, there is no an easy way to do this. But may be you can hack this by writing something like this in the OnShow event of for example TsiFindDialog:
procedure TForm1.siFindDialog1Show(Sender: TObject);
var
hnd: THandle;
R: TRect;
begin
with siFindDialog1 do
begin
if (siLang = nil) or (siLang.Language <> 'Dutch') then
Exit;
GetWindowRect(Handle, R);
SetWindowPos(Handle, 0, 0, 0, R.Right - R.Left + 26, R.Bottom - R.Top, SWP_NOMOVE or SWP_NOZORDER);
hnd := GetDlgItem(Handle, 1);
SetWindowPos(hnd, 0, 0, 0, 100, 23, SWP_NOMOVE or SWP_NOZORDER);
hnd := GetDlgItem(Handle, IDCANCEL);
SetWindowPos(hnd, 0, 0, 0, 100, 23, SWP_NOMOVE or SWP_NOZORDER);
end;
end;
Yes, you can use TsiLang components in IntraWeb applications in the same way as in usual VCL/FMX applications. The demo project could be downloaded from http://www.sicomponents.com/soft/IW_SiLang.zip
The same applies for any other web framework library, like UniGUI and others. You can check the video sample of UniGUI application translated with TsiLang components on our Videos page.
Yes, although this requires some tricks to be done. Please find the details in our forum post…
There are two possible cases:
Just use the Resource Strings Import Wizard to import the used resource strings into the TsiLang component. In order to be able to control 3rd party forms’ Font and Charset used to display under each language you can use the TScreen.OnActiveFormChange event. For example:
TForm1 =class(TForm){…}procedureFormCreate(Sender: TObject);private{ Private declarations }procedureOnFormChange(Sender: TObject);{…}
end;
{…}procedureTForm1.FormCreate(Sender: TObject);
beginScreen.OnActiveFormChange := OnFormChange;end;procedureTForm1.OnFormChange(Sender: TObject);beginif(Screen.ActiveForm <>nil)and(Screen.ActiveForm <> Self)thenScreen.ActiveForm.Font.Assign(Self.Font);end;
You will have to place TsiLang on each 3rd party form, add this form to your project and translate it as it would be a usual form from your project.
There is a small bug (or as designed) in the TDBNavigator component. To fix it you may use the following sample code:
procedureTForm1.FormCreate(Sender: TObject);beginDBNavigator1.Hints.CommaText := siLang1.GetStringValue(@siLang1.MultiLines, 'DBNavigator1.Hints', siLang1.ActiveLanguage);end;
When an XP Theme enabled the Developer Express components convert AnsiString to WideString using the application default locale. You can fix this by changing application’s thread locale on language changing event. For example:
procedureTForm1.siLang1ChangeLanguage(Sender: TObject);beginifsiLang1.ActiveLanguage = 1thenSetThreadLocale(LANG_ENGLISH)elseSetThreadLocale(LANG_JAPANESE);end;
SysLocale global variable could be used in the later versions of the Delphi and C++Builder:
procedureTForm1.FormCreate(Sender: TObject);beginifSysLocale.PriLangID = LANG_ENGLISHthensiLangDispatcher1.ActiveLanguage := 1elseifSysLocale.PriLangID = LANG_GERMANthensiLangDispatcher1.ActiveLanguage := 2elseifSysLocale.PriLangID = LANG_FRENCHthensiLangDispatcher1.ActiveLanguage := 3elsesiLangDispatcher1.ActiveLanguage := 1;end;
Also you can use the WinAPI to detect the OS’s default language:
procedureTForm1.FormCreate(Sender: TObject);varLangID: DWORD;beginLangID := GetUserDefaultLangID;caseByte(LangIDand$03FF)ofLANG_ENGLISH: siLangDispatcher1.ActiveLanguage := 1; LANG_GERMAN: siLangDispatcher1.ActiveLanguage := 2; LANG_FRENCH: siLangDispatcher1.ActiveLanguage := 3;elsesiLangDispatcher1.ActiveLanguage := 1;end;
Or you may consider reading this useful article “Creating Multilanguage Applications Translated by Users“.
Sometimes, under the Windows XP with themes enabled the main menu’s background becomes white after changing the languages. This is known as the XP bug and as workaround could be used as follows:
The following Delphi code demonstrates this:
MainMenu1.Images :=nil; siLangDispatcher.ActiveLanguage :=(computed value); MainMenu1.Images := ImageList1;
It looks like you don’t have all the update and service packs installed into Delphi 6. Please install all the available service and update packs (including RTLUpdate 3) because TsiLang package was compiled with all the latest packs installed.
This was the price to have a single packages for Delphi and C++Builder. If you use only the C++Builder you can fix this by adding {$DEFINE BCB} at the first line of SI.INC file and re-build the TsiLang packages. If you need to use both Delphi and C++Builder or you don’t have Full Source edition, or you don’t want to re-build TsiLang packages then you will need to set siLang_Def_UsedInCpp global variable declared in siComp.hpp to true in your C++ projects right after the Application->Initialize(); call.
Compiled units (DCU) are provided ONLY for the Win32, Win64, Android, Linux and OSX platforms. iOS DCUs are generated for iOSSimulator target. So if you need to build your projects for iOS target platform you will need to re-build your project using the sources of the TsiLang Components Suite units.
If you get a crash during installing of the registered version of the TsiLang Components Suite on the Windows Server platform, please turn OFF the Data Execution Prevention (DEP) OS’s setting. DEP is ON by default on the Windows Server platforms and this may cause a crash during the install.
When you use the VCL Styles to apply styles to your RAD studio applications the message boxes displayed by TsiLang are not styled in case the UseTaskDialog property of the TsiLang is set to True. To prevent this you can just set this property to False.
But in case you would like to have message boxes based on the Task Dialog when there is no application style active, you can use the following trick:
The following code sample demonstrates this:
procedure TForm1.ScreenFormChange(Sender: TObject); procedure ProcessActiveForm(AForm: TCustomForm); var I: Integer; begin for I := 0 to AForm.ComponentCount - 1 do if AForm.Components[I] is TsiCustomLang then begin TsiCustomLang(AForm.Components[I]).UseTaskMsgDlg := StyleServices(AForm).IsSystemStyle; Exit; end; end; begin if Screen.ActiveCustomForm <> nil then ProcessActiveForm(Screen.ActiveCustomForm); end;
You need just to assign the FileName property of the dispatcher component and call LoadAllFromFile() method:
procedure TForm1.FormCreate(Sender: TObject);
begin
siLangDispatcher1.FileName := "YourSILorSIBFileName.SIL";
siLangDispatcher1.LoadAllFromFile(siLangDispatcher1.FileName);
end;To translate TsiLang Components Suite just add your language to the tsilang_translations.sib file and specify the filename in the Custom file field under TsiLang Expert Language Options.
A step by step guide on how to add a language to the SIB file can be found here: Translate software with SIL Editor: A Step-by-Step Guide
The question "<file> already exists. Do you want to replace it?" is shown by Windows itself, as a system message box titled "Confirm Save As", when ofOverwritePrompt is in the Options of the save dialog. TsiLang cannot translate it. To show the question in your program language, remove ofOverwritePrompt from Options and ask the question yourself in the OnCanClose event of the dialog:
procedure TForm1.siSaveDialog1CanClose(Sender: TObject; var CanClose: Boolean);
begin
CanClose := not FileExists(siSaveDialog1.FileName) or
(siLang1.MessageDlg(Format(SOverwriteQuestion, [siSaveDialog1.FileName]),
mtConfirmation, [mbYes, mbNo], 0) = mrYes);
end;
SOverwriteQuestion is your own string, for example '%s already exists. Do you want to replace it?'. Keep it in the TsiLang component like any other string, so it is translated with the rest of your program.
Please note that with the ofOldStyleDialog option the VCL does not call OnCanClose, so this method works only with the default dialog style.
Did not find your answer? Ask on the forum or contact us.
Your app’s next language starts here
Try every feature with your own project.
Fully functional trial. Keep your IDE running while your localized application runs.
Learn & connect
© 1998–2026 Igor Siticov, SiComponents. TsiLang®, Resource Builder® and SiComponents® are registered trademarks of Igor Siticov.
RAD Studio, Delphi and C++Builder are trademarks and/or registered trademarks of Embarcadero Technologies, Inc.