Document home

Scan Rules

Scan rules are a list of rules that specify what properties are scanned (e.g. localized) from the user interface resource files. Scan rules are used in the following platforms:

Platform Description Handling of properties
Android Property is an attribute value in a layout file (.xml) Only those properties that have a matching scan property are scanned.
Delphi, VCL Property is a value in a form file (.dfm) All string properties except those that have a matching scan property are scanned. Other but string properties are only scanned if there is a matching scan property.
Delphi, FireMonkey Property is a value in a form file (.fmx) All string properties except those that have a matching scan property are scanned. Other but string properties are only scanned if there is a matching scan property.
Windows Forms Property is an element in a form resource file (.resx) All string properties except those that have a matching scan property are scanned. Other but string properties are only scanned if there is a matching scan property.

WPF

Property is an element value or an attribute value in a XAML file (.xaml) Only those properties that have a matching scan property are scanned.

UWP

Property is an element value or an attribute value in a XAML file (.xaml) Only those properties that have a matching scan property are scanned.

Xamarin

Property is an element value or an attribute value in a XAML file (.xaml) Only those properties that have a matching scan property are scanned.

When scanning Android, QML, or XAML resources only those properties that have a matching value in the scan rules list are scanned. All other properties are skipped. When scanning Delphi (VCL or FireMonkey) or Windows Forms resources the scanning of the property depends on the type of the property. If the type is not a string then the property is scanned like an Android, ASP.NET or XAML property. This means that property is scanned only if there is a match in the scan properly list. If the type is a string then scanner behaves in a different way. By default all string properties are scanned except those that have an exclusive match in the scan rules list. The scanning choice is different because Delphi and Windows Forms resources contain type information of each property item unlike Android, QML and XAML resources that do not contain type information.

A rule is always a combination of component type name and a property name. Both component type names and property names can contain wildcard characters (* or ?) to make them more generic. In addition each rule has a flag that tells if the rule sets the property to be localized or to be ignored. For example the following table contains some possible rules:

Component type Property name Localize Description
Button Text localize Makes Soluling to localize the Text properties of all instances Button components.
* Text localize Makes Soluling to localize the Text properties of all components.
Button *Text localize Makes Soluling to localize all the properties of all instances Button components where the property name ends with Text.
For example Text, HintText or ActiveText.
MyButton Text ignore Makes Soluling to ignore localization of the Text properties of all instances MyButton components.

Use exclude operation to disable certain properties or components in the case you have first turn localization on by using another rule that has * as component type name.

You can attach rules to every node in the project tree. When scanning data the rules closest to the current item are used first. If that rule set does not contain a match then rules of the parent items are used. This is repeated until the root rules (i. e. application rules) are met. A sample cascading path of a component is form node -> source -> group source -> project -> application.

Item Description Default value How to edit
node The rules used by all components of the selected node. Empty Right click a form or dialog node on the project tree and choose Options menu. Select Scan properties rules sheet.
source The rules used by all nodes of the selected source. Empty Right click a source on the project tree and choose Options menu. Select Scan properties rules sheet.
project The rules used by all sources of the current project. Empty Choose Project sheet on the ribbon and in Rules group click the platform whose rules you want to edit.
application The default rules used by all projects using the same platform. Default rules Choose Options sheet on the ribbon and in Platform group click the platform whose rules that you want to edit.

When you create a new project it will contain no rules. Each item of the project (e.g. project, source or form) will have empty rule list. This makes them to use the application rules. Application rules by default contain the default values that work on most projects. Once you have created your project you can add, remove or edit the rules of any items or the project. Add a new rule to the project if you want to use it only on that project. Add a new rule to the application options if you want to use the rule on every project.

By default only scan rules are used to determine if a property should be scanned or not. However you can change this for each data type. Each data type has a flag that specifies how properties of that type are scanned. Possible values are:

Value Description
By rules Default. Scan rules are used to determine if a property is scanned or not.
Yes All properties of this type are scanned no matter the scan rules.
No All properties of this type are ignored no matter the scan rules.

Use Data types sheet to change data type settings.