Localize Messages in Validation Scripts
- Last UpdatedNov 15, 2023
- 1 minute read
Localize a message in a validation script to make it usable with a specific language, script, and culture.
To localize a message in a validation script
-
Open an existing text file or create a new text file in the <AVEVA Work Tasks Install Path>\Locales\<culture>\Forms2\Standard folder.
-
Add a key-value pair in the following format: <message>:<localized text>.
Example
To display a localized message, say, Special characters are not allowed., when validating the Employee Name property through a script, add a key-value pair in an existing or a new text file in the <AVEVA Work Tasks Install Path>\Locales\<culture>\Forms2\Standard folder as InvalidEmployeeName: Special characters are not allowed.
Validation Script
if (currentValue==="%")
{
return new ValidationOptions(false,skelta.localize.getString("InvalidEmployeeName"));
}
Key-Value Pair
InvalidEmployeeName: Special characters are not allowed.