# Tool to autotranslate BPL-Ressources to PO file (c) 2003 XAN

## Background:

Because I'm very lazy and it makes no fun to translate the messages one by one (Borland has done a good job and translated every ressourcestring and form to german language, why should I do it again?!) I have developed a tool to automatically translate the stringtables (ressourcestrings in Delphi) and Forms inside the Borland BPL files.

I only have to specify which BPL files and corresponding language dependent files (e.g. the pair VCL70.bpl and vcl70.de as the german ressource file) should be included for translation.

The tool than extracts and assigns the english and foreign stringtables. In the next step it will fill the PO template with the desired translations: searchs for the english text in the msgid lines and put the translation in the msgstr lines.

In a couple of minutes I was able to fill the Delphi7 template with the translations originally released by Borland ;)

The tool also able to create a PO template for your project (e.g. exe file) with all ressourcestrings and forms including that used by third party software.

## Hint:

The result (count of translated messages) will be the best if you use the Delphi Architect version.

Because I'm using only the Delphi Professional version and so are many BPLs like decision cube or WebSnap not included, only 83% of the PO file was filled.

This tool should work with all Delphi versions and languages wich are available through Borlands supplied language dependent ressource files.

## Using the tool:

### Merge PO file

example: german Delphi 7 Professional and Win2000

first run:

1. select "<windows system directory>\*.bpl" as files to extract.
2. select ".de" as file extension for german ressource files.
3. click "extract ressources"
4. after a couple of minutes you can proceed with step 2:
5. get the appropriate german template for Delphi7 from "http://www.dybdahl.dk/dxgettext"
6. set the field with the PO file to merge to "delphi7.po"
7. Uncheck the "UTF8"-box if the template does not use this format (UTF8 is default)
8. click "Merge PO file" and the delphi7.po file will be filled with available translations

second run:

repeat the first run with "<Delphi install directory>\bin\*.bpl" as files to extract.

third run:

repeat the first run with "<Delphi install directory>\rave5\*.bpl" as files to extract.

### Create PO file:

example: this translation tool

1. select "<directory>\translation.exe" as file to extract.
2. clear the field with the file extension.
3. click "extract ressources"
4. set the field with the PO file to merge to "default.po"
5. click "Create PO file" and the default.po file will be filled with the strings included in translation.exe

## License:

This tool is licensed under MPL 1.1 (Mozilla Public License). See OSI for complete text of the license before using this tool.

## Author:

(c) 2003 XAN
www.xan.de
info@xan.de