ATTENTION! You can still use the DeLoc from this page but it is strongly recommended to use the new version DelLoc (click here)
"DeLoc" (Delphi localization compiler) lets You to localize delphi application to any languages. You can translate string constans included in the resourcestring blocks and any string properties of the project forms and components.
To localize your delphi program You have to make next simple things:
If You want to localize string constant from resourcestring block You have to compile project with detailed map file (Choose delphi menu item "Project->Options", tabsheet "Linker" and click item "Map file->Detailed" then rebuild your project). Compiler will make special file with "drc" extension.
To create new localization file in DeLoc choose menu item "File->New". In the opened window choose "exe"-file that need to be localizated and corresponded "drc"-file.
After appearing "Import parameters" window select genue langauge of your application. You also can define masks for filtering strings and component properties that will be localized. Press button "OK". The "Content" window will contents the hierarchy list of the component properties and string constants based on their membership in the sourse files. In dependence of the selected item in "Content" window main grid will show corresponded strings and properties with genue means.
Choose menu item "Languages->Languages" and in the appeared window add to localization file the necessary languages. You can use at any time this window to add or remove localization languages from project.
In the main grid or in the multiline editor enter translation for added languages.
Save and compile localization file by choosing menu item "File->Save and compile". Compiled file is ready to use. If You includes project info in the localization file then you can modify and synchonize it with changes that you made in your project. Also you can use localization file to export translations into another projects.
To modify and synchronize localization file with changes in your project and to import translation from another projects you have to open file with menu item "File-Open". Then choose menu item "Translation->Import translation". Select files with which you want to synchronize localization file or select files to import translation. In window "Import parameters" select languages to synchronize/import and optionally add masks to filter string constants and component properties. Press button OK.
Unit LcUnit.pas includes declaration of the two functions: LoadLcf() and TranslateComponent(), and declare one type: TLcCallBack.
Function LoadLcf() loads localization file and activates translation for the passed locale identificator.
function LoadLcf( const sFileName : string; iLCID : LCID; pCallBack : TLcCallBack; pUd : pointer ) : integer;
Parameters:
Result:
Function TranslateComponent() translate the interface and form's components string propertied.
function TranslateComponent( oComponent : TComponent ) : boolean;
Parameters:
Result:
The type TLcCallBack is a prototype of the callback function which pointer is passed into LoadLcf() as parameter. The callback function will be called for each locale identificator supported by the localization file.
type TLcCallBack = function( iLCID : integer; pUd : pointer ) : integer; stdcall;
Parameters:
Results:
To switch the langauges at runtime You may use next code:
var
i : integer;
begin
for i := Screen.FormCount - 1 do TranslateComponent( Screen.Forms[ i ] );
end;
DeLoc includes demo-project that shows how to:
The program package includes:
1. DeLoc version 1.11 (SOFTWARE) is freeware. You can freely use this in any projects (including shareware and commercial) without any fee or payment to author.
2. All copyrights to SOFTWARE and all parts of the SOFTWARE are exclusively owned by the author - Serge Gavrilov.
3. SOFTWARE can be freely distributed in non modified form as it's distributed by the author. Nobody can take the payment for distribution of the SOFTWARE without the written sanction of the author.
4. DeLoc IS DISTRIBUTED "AS IS". NO WARRANTY OF ANY KIND IS EXPRESSED OR IMPLIED. YOU USE AT YOUR OWN RISK. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.
5. Any modification of the SOFTWARE are prohibited.
6. Installing and using SOFTWARE signifies acceptance of these terms and conditions of the license. If you do not agree with the terms of this license agreement you must remove all SOFTWARE files from all your storage devices and cease to use the SOFTWARE.
The author of DeLoc (Delphi localization compiler) - Serge Gavrilov, Russia, Saint-Petersburg.
e-mail: sergegavrilov@mail.ru
icq: 777807
odigo: 471530
Top of site