Understanding the Dictionary Feature
The dictionary feature allows user-created strings to be 'translated' i.e. replaced with alternate strings for a variety of features, including:
- Mimics
- Trends
- Query Lists
- Data Grids
- Data Tables
- Alarm Severities
- Alarms List Column Entries
- Point State Descriptions.
The Dictionary feature is often used for translating user-created strings into another language and replacing terminology (for example, terms that are not widely understood). It works by allowing system users to mark strings for translation with a @ prefix. Then, either a ClearSCADA server or client will search for that marked string in dictionary files. When the marked string is located, ClearSCADA will read the translation for the string, and then use the translation instead of the marked string on Mimics, Trends, Lists, etc.
The Dictionary works with many ClearSCADA features, but requires:
- Dictionary files to be configured so that they contain user-created strings (search strings) and replacement strings (translations). There are three types of dictionary file, and ClearSCADA will search them in order:
- Country-specific file
- Region independent file
- Default dictionary file.
ClearSCADA can only search the Country-specific file and Region independent file if the Locale of the logged on user and the dictionary files are the same (see Creating Dictionary Files for Translating System Information). The locale of the user is defined in the User account configuration and the locale of the dictionary files is defined in the name of the files.
- Dictionary files to have names that indicate the language and region, for example, fr-CA.txt represents French language, Canadian region. This defines the Locale of the dictionary file.
- The dictionary files to be configured so that there is a search string and replacement string on each line. Each string has to be enclosed in double quotes " " and there has to be one search string and its replacement string, separated by a comma, on each line. For example:
"low water level", "niveau bas d'eau"
- Users to log on via User accounts that have the same Locale setting as the locale of the dictionary files. For example, if a user is logged on via a User account that is set to English (US) and the dictionary file is fr-CA.txt (for French language, Canadian region), the dictionary file is ignored.
- Users to mark the strings that are to be ‘translated’ by the dictionary feature. To do this, users have to enter a @ character at the start of the string, for example, @water level.
When the Dictionary files are configured correctly, the search and replace process works like this:
- A user marks a string value for translation by adding a @ prefix.
- Depending on where the string appears, either the ClearSCADA server or the ClearSCADA client detects the marked string and begins the search.
- The server or client compares the locale of the user’s User account to the locale of the country-specific dictionary file. If the locales match, ClearSCADA searches for the marked string in the file. If the locales are different, ClearSCADA cannot search in the country-specific file and so proceeds to check the region-specific dictionary file (see step 5).
- If ClearSCADA is searching the country-specific file, it reads the search string entries in the file. If any of them match the marked string, ClearSCADA reads the replacement string. It then uses the replacement string in place of the marked string wherever applicable (on Mimics, Trends, Lists etc.), and the search and replace process ends.
If ClearSCADA cannot find the marked string in the country-specific file, it continues the search in the region-specific file (see step 5).
- ClearSCADA compares the locale of the user’s User account to the locale of the region-specific dictionary file. If the locales match, ClearSCADA searches for the marked string in the file. If the locales are different, ClearSCADA cannot search in the region-specific file and so proceeds to check the default dictionary file (see step 7).
- If ClearSCADA is searching the region-specific file, it reads the search string entries in the file. If any of them match the marked string, ClearSCADA reads the replacement string. It then uses the replacement string in place of the marked string wherever applicable (on Mimics, Trends, Lists etc.), and the search and replace process ends.
If ClearSCADA cannot find the marked string in the region-specific file, it continues the search in the default file (see step 7).
- ClearSCADA reads the search string entries in the default dictionary file. If any of them match the marked string, ClearSCADA reads the replacement string. It then uses the replacement string in place of the marked string wherever applicable (on Mimics, Trends, Lists etc.), and the search and replace process ends.
If ClearSCADA cannot find the marked string in the default dictionary file, it ends the search. ClearSCADA will continue to use the marked string in its current form, but will remove the @ prefix automatically.
Example:
A system user logs on via a User account that is set to the English (UK) locale and configures a text box on a Mimic to have the value:
@High Level
The server is associated with a dictionary folder that contains dictionary files named en-GB.txt, en.txt, and Default.txt. The @High Level string and its replacement are included in the en.txt file:
"High Level", "High Pressure".
This means that the client will replace the string High Level with the string High Pressure.
As the text box value string is prefixed with the @ character, the client will search for the @High Level string in the dictionary files and attempt to replace it with the 'translated' version. The client searches the dictionary file as its file name is set to represent UK English which matches the Locale setting of the user's User account. (For information on the dictionary file names, see Creating Dictionary Files for Translating System Information).
The client begins by searching in the country specific file (en-GB.txt). As the country specific file does not contain the search term, the client continues its search in the region independent file (en.txt). It locates the search term (High Level) and its 'translation' (High Pressure). The client automatically replaces the "High Level" string with "High Pressure" in the text box shown on the Mimic.
Further Information
ISO Standards: For information on ISO standards, please refer to www.iso.org