Resource File Format

Resource files are straightforward XML files that follow a format defined by Microsoft and used by Iron Speed Designer and by your applications.  An example ProjectTemplate.resx file is shown below.

<?xml version="1.0" encoding="utf-8"?>

<root>

     <data name="Language">

          <value>en-US</value>

     </data>

 

     <data name="val:ValueIsRequired">

          <value>{FieldName} value is required.</value>

     </data>

 

     <data name="val:InvalidValue">

          <value>The {FieldName} value you entered is invalid.  It may be invalid for a number of reasons.  You may have entered a value that is longer than what is allowed, the value may contain invalid characters or the value might be out of range of allowed values.  Please review the value and correct it and submit the changes again.</value>

     </data>

 

     <data name="val:ValueTooLong">

          <value>Value for {FieldName} is too long</value>

     </data>

Each entry in the resource file has a Name and a Value.  The Name is the name of the string resource, called a Resource Key.  The value is the localized string to be used in your application.

Some validation messages, such as “field value” validation messages, are parameterized by name.  You can localize (translate) the message text.  However, do not translate or change the substitution parameters, e.g., {FieldName}, because your application uses these substitution parameters at run-time.

Resource keys have prefixes, called Resource Key Prefixes:  "Txt" (for Text), "Val" (for Validation Message), and "Btn" (for Button).  Their primary purpose is to distinguish keys from values when viewing and editing the string resource files.

Resource Key Prefix

Use

Btn

Button text.

Err

Error messages.

Txt

Dialog box titles and other general purpose text strings.

Val

Validation error messages.

The following caveats apply:

See Also

Customizing Error and Validation Message Strings