Delphi/C++Builder Source Scanner

Delphi/C++Builder Source Scanner picks the strings to localize from source codes of a Delphi/C++Builder project. Its output is an MLD file (Multilizer binary dictionary) that is used by Multilizer Localization Components.

The most important settings for Delphi/C++Builder Source Scanner are the following:

  • Delphi/C++Builder Project File (all tabs); the location of the Delphi/C++Builder project.
  • Library type is either Unicode (newest Delphi/C++Builder versions) or ANSI project type (Delphi/C++Builder 2007 or earlier versions)
  • Output file (Output tab); the path to the output (MLD) file.
  • Write mode (Output tab); select whether to overwrite an existing MLD file or append translations to it.




Options

Delphi/C++Builder project file defines the location of the project that should be scanned. The scanner can scan either an application project or a package project source. Also group project (.grouproj) format is supported.

Uncheck Parse the source code files from project file, if the scanner should not scan the sourcecode filename from the project. In this case the files should be specified on File List tab.

Note! Although it's not required that project file exists -- when scanning only files specified on File List -- we recommend that the project file exists for the following reasons:

  • The MLD file name (specified on Output tab) is by default the same as project name with .mld file extension.
  • It is possible to specify filenames with relative path on File List tab, where file position is related to project file name.

Tabs

Preferences

The encoding and the library type are defined on the preferences tab. These settings affect the encoding that is used when reading the source files. If the scan results show grabage characters then this is the first place to check.

  • Encoding can be either any ANSI codepage or Unicode.
  • Library type is either Unicode (newest Delphi/C++Builder versions) or ANSI project type (Delphi/C++Builder 2007 or earlier versions)

Log duplicate contexts during scan option will add a notification in scan log about all strings that have identical context. This means that different instances of the same string appear only once in Multilizer project. Note! Checking this option may cause a big amount of log entries.

Checking Scan string tables from the executable file make Multilizer scan resource strings from the compiled executable. The scanner determines the executable name, i.e., it assumes that the executable is in the same directory as the project.

Scan commented lines option causes the scan of strings that are commented out in the source code.

Output

The location where the MLD file is saved is defined on the output tab.

The write mode can be

  • either overwrite
  • or append

If the append mode is selected, the scanner writes the translations in that target to an existing MLD file. This is particularly useful in multi-target projects where the translations in all targets should be written to a single MLD file. In this scenario the first target should be configured to overwrite the existing MLD file and all subsequent targets should be configured to write in the append mode.

Switch from append mode to overwrite mode... causes the scanner to create even in append mode a new MLD file, if the output file doesn't exist. If this option is not checked, the build will fail, if append mode is selected and MLD file doesn't exist.

Check Write empty translations to MLD file option, if you want that rows with no translations are written to the MLD file. This is normally not necessary, because Multilizer Localization Components will by default use native string in case of missing translation. Leaving this option unchecked will reduce the size of the MLD file.

Tags

The user can configure how to strings are extracted from the source code on this tab.

Include Tags define keywords that Multilizer should look for in the source code comments:

  • If the keyword is found, Multilizer will scan the string.
  • If there's any more comment text after the keyword, Multilizer will read in that as row comment to the project.
  • If Multilizer detects maxchar=N in the comment, Multilizer will automatically set a maximum width for the string in the porject.

Exclude Tags list keywords that Multilizer looks for to determine that the string should not be scanned and included in the prject.

Translate Functions define names of functions that contain string parameters requiring localization. This gives an alternate way to Include Tags for marking texts for localization.

Check Scan All Strings if you want to scan all strings in the project. This is the fastest way to get the scanner pick strings from the source code, especially when the source code hasn't been tagged as explained above.

Settings

These settings provide further control over which strings the scanner plug-in returns.

In Multilizer it is possible to exclude strings both in the Multilizer application (Project-->Excluded strings) and in the scanner options (see below). It is preferable to exclude the strings in the scanner, because the performance is better.

If the scanner finds strings that solely consist of the characters entered here, it is not scanned.

Check Add whitespaces to the list above if you want to expand the check with CR, LF, TAB, etc.

Included Strings

On this tab the user can select groups of strings that are included in project.

String groups can be included

  • either manually by checking string groups in the checkbox list
  • or automatically by checking "Automatically add Included Strings to project" checkbox

Automated addition of strings. Certain strings can be added automatically. For example, if Multilizer detects that the source code contains the standard Open dialog, it automatically adds the corresponding strings to Multilizer project as included strings.


Project Strings

The user may add any number of Project strings on this tab. Each line of text is added as localizable string to the Multilizer project (note that the target must be re-scanned after strings have been added).


VCL System

These settings affect the internal processing of some form components.

File List

By default the scanner tries to automatically find the source code files by parsing the project file.

On this tab the user can manually specify more files to scan.

  • Add specific file either by specifying a filename or multiple files with a wildcard.
  • Files can be specified either with absolute path or with relative path, where the path is relative to Delphi/C++Builder project location.
  • Check a list item to acuse scanner to recurse in subdirectories.

Properties

This tab allows user to specify by property name what to localize. Similar properties can be excluded by using wildcards; e.g., *text will exclude both sqltext and text.

For example [ ] Caption means that all captions are excluded from localization.