Customizing Error and Validation Message Strings

Applications built with Iron Speed Designer contain a variety of data validation, information, and error messages that are automatically included in your application.  The error message and validation message strings displayed by your application are contained in:

These libraries contain translation resources for a number of cultures and languages. In addition you may change these messages to conform to the language and format of your choice.  They are physically contained in two separate resource files (RESX), which are copied to your application.  The files that are copied are considered part of your application and should be included when you move your application into production.  Messages are retrieved from the files by your application at run-time.  The files are:

<UI Culture> is the valid ISO culture name, e.g.:

MyApp1.en-US.resx

MyApp1.de-DE.resx

MyApp1.it-IT.resx

BaseClasses.<UI Culture>.resx

When you create an application or select a new culture, Iron Speed Designer selects a file from the base class library and places it into your application’s project folder:

...\<App Name>\bin\BaseClasses.<Culture>.resx

The actual file names depend on your application’s chosen locales, e.g.:

...\<App Name>\bin\BaseClasses.es-PA.resx

...\<App Name>\bin\BaseClasses.en-US.resx

You can edit these text strings directly.  We recommend using the Visual Studio XML editor.  (Note:  You should never modify files in the Base Classes library (folders) directly, since these files are automatically upgraded by Iron Speed Designer when installing new versions.)

ProjectTemplate.<UI Culture>.resx

When you create an application or select a new culture, Iron Speed Designer selects a file from the application resource library and places it into your application’s project folder:

...\<App Name>\bin\<App Name>.<UI Culture>.resx

The actual file names depend on your application’s chosen locales, e.g.:

...\<App Name>\bin\<App Name>.es-PA.resx

...\<App Name>\bin\<App Name>.en-US.resx

You can edit these text strings directly.  We recommend using the Visual Studio XML editor.  (Note:  You should never modify files in the application resource library (folders) directly, since these files are automatically upgraded by Iron Speed Designer when installing new versions.)

Resource files at run-time

In some cases, your resource file or specific resource strings in the resource file may not be used at application run-time.  When the .NET Framework is unable to locate your resource files or a particular resource string within a resource file, it uses the resource name by default because it does not have any other information.  This can occur for a variety of reasons, including:

Example: Internationalize table column headings (field names)

Step 1:  Use the Application Wizard to add multiple languages for your application.  This creates a resource file (RESX) for each selected language in your application’s App_GlobalResources folder, e.g.:

AcmeOMS.de.resx

AcmeOMS.en-US.resx

AcmeOMS.fr.resx

AcmeOMS.it.resx

AcmeOMS.resx

Step 2:  In your application’s App_GlobalResources folder, open each resource file and add resource entries for the column headings, e.g.:

Resource Key

Value

Txt:Customer

Customer

Txt:OrderID

Order Number

The Resource Keys should be the same, regardless of language.  However, the string values should be language specific.

Step 3:  In Iron Speed Designer, open the page that will use these column heading strings.  Then navigate to the table panel containing the column headings.

Step 4:  In the Layout Editor, select the label control you wish to have a language-specific text string. 

Step 5:  In the Property Sheet, change the Text property to use the resource key you entered in your application’s resource files.

Group

Property

Value

Appearance

Text

{Txt:Customer}

Be sure to enclose the resource key in curly braces.  This instructs Iron Speed Designer to emit code that retrieves the string from the resource file.

Step 6:  Build and run your application.

Step 7:  In your application, select the appropriate language from the Upper Tool Bar and your page will update to display the correct language-specific labels.

See Also

Localizing (Internationalizing) Your Application

Resource File Format

Editing Resource Files

Enabling Language Support in Microsoft Windows

Customizing Error and Validation Message Strings