Localizing (Internationalizing) Your Application

Iron Speed Designer automatically creates multi-lingual, multi-cultural applications.  You can instruct Iron Speed Designer to build your application for a particular culture via the Application Information screen of the Application Wizard in Iron Speed Designer.

Applications built with Iron Speed Designer support local date formats, currency symbols and character sets.

A variety of factors, settings, and parameters contribute to a localized application:

Culture Encoding

The culture encoding attributes in your Web.config file determine many aspects of your .NET application, including currency, date, and number format.  Your application uses these settings at run-time to determine proper operation.  Since these culture encoding attributes are used by the .NET Framework, Iron Speed Designer does not use them directly.  However, a discussion of them is included here due to their importance in localizing your application.

The culture encoding attributes are in the <configuration> section of Web.config, e.g.:

<configuration>

     <system.web>

          <globalization

              fileEncoding="utf-8"

              requestEncoding="utf-8"

              responseEncoding="utf-8"

          />

     </system.web>

</configuration>

The following localization and culture encoding attribute information is from Microsoft’s “Setting the Culture and UI Culture for Web Forms Globalization.”

Attribute

Description

Culture
uiCulture

By specifying a culture it is possible to use a set of common preferences for information like strings and date and number formats that correspond to users' cultural conventions.  A Web Forms page has two culture values, Culture and UICulture.  The Culture value determines or influences results of culture-dependent functions, such as displaying the date.  The UICulture value determines how the resources are loaded for the form and is used for culture-specific lookup of resource data.  The only purpose of the UICulture value is to indicate the language the resources should load, that is, determine which language the UI strings should use.  The Culture value determines everything else — date formatting, number formatting, and so on.

The two culture settings do not need to have the same value.  Depending on your application, it may be important to set them separately.  An example is a Web auction site.  The UI culture changes for each Web browser, but the culture stays constant, so prices are always displayed in the same currency and formatting.

The Culture value can only be set to specific cultures such as en-US or en-GB.  This prevents the problem of identifying the correct currency symbol to use for "en", where en-US and en-GB have different currency symbols.

fileEncoding

Specifies the default encoding for .aspx, .asmx, and .asax file parsing.  Unicode and UTF-8 files saved with the byte order mark prefix will be automatically recognized regardless of the value of fileEncoding.

requestEncoding

Specifies the assumed encoding of each incoming request, including posted data and the query string.  If the request comes with a request header containing an Accept-Charset attribute, it overrides the requestEncoding in configuration.  The default encoding is UTF-8, specified in the <globalization> tag included in the Machine.config file created when the .NET Framework is installed.  If request encoding is not specified in a Machine.config or Web.config file, encoding defaults to the computer's Regional Options locale setting.  In single-server applications, requestEncoding and responseEncoding should be the same.  For the less common cases (multiple-server applications where the default server encodings are different), you can vary the request and response encoding using local Web.config files.

responseEncoding

Specifies the content encoding of responses.  This governs the character set used to display your application’s web pages and emails sent from your application.

Set responseEncoding to an appropriate value to ensure emails sent from your application are correctly encoded and display your language’s complete character set.  For example, if your default language is French and you want French characters from the extended French character set to be correctly included and displayed in your emails, may set responseEncoding to “windows-1252”.  Remove the responseEncoding parameter to use the setting in your machine.config file or to use the encoding defaults in your computer's Regional Options locale setting.

The default encoding is UTF-8, specified in the <globalization> section in the Machine.config file created when the .NET Framework is installed on your machine.  If response encoding is not specified in your Machine.config file or your application’s Web.config file, encoding defaults to your computer's Regional Options locale setting. 

In single-server applications, requestEncoding and responseEncoding should be the same.  For the less common cases (multiple-server applications where the default server encodings are different), you can vary the request and response encoding using local Web.config files.

For more detail, see:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskeditingwebconfigfileforwebformsglobalization.asp

An example Show Order Table page with set to display certain dates and currencies in localized formats.

Here are the localization settings for the Show Order Table page shown above.  The Web.config globalization entry is set to “fr-FR” which, in turn, causes the Euro currency symbol to be used since the Euro is the official currency in France.  Similarly, the DD/MM/YYYY European date format is used.

<!--  GLOBALIZATION

     This section sets the globalization settings of the application.

-->

     <globalization

          fileEncoding="utf-8"

          requestEncoding="utf-8"

          responseEncoding="utf-8"

          culture="fr-FR"
          uiCulture="fr-FR"

     />

Page Encoding

Iron Speed Designer automatically sets the page encoding to UTF-8.  (There are several HTML page encodings, including UTF-8, UT-16, and UTF-32.)  In particular, Iron Speed Designer creates ASPX pages and ASCX controls with a UTF-8 Byte Order Mark (BOM) EF BB BF at the beginning of file.  While not strictly required, this is considered the “correct way to do things” by many application developers.

For more detail on the UTF-8 page encoding, we recommend:

For more details on UTF-8 and the byte order mark, we recommend:

Character Sets

You can insert Unicode characters into your application’s source files in a variety of ways.  Unicode characters may appear in:

Note:  We recommend that you use only ASCII characters in:

Currency Formatting and Validation

Some currency formats use a decimal point to separate values, other formats use commas.  Iron Speed Designer supports currency display in any localized format supported by the .NET Framework.

The table below shows several examples of currency symbols displayed for the number 123456789.76.

Culture Encoding

Format

en-US

$123,456,789.76

es-ES

123.456.789,76 €

es-UY

$U 123.456.789,76

ru-RU

123 456 789,76p

sr-SP-Latn

123.456.789,76 Din.

sv-SE

123.456.789,76 kr

Iron Speed Designer also supports currency validation in any localized format supported by the .NET Framework.  This is accomplished by server-side validation, rather than client-side validation, allowing validation to be tailored to the locale of the web server.

Date Formatting and Validation

Iron Speed Designer supports date display in any localized format supported by the .NET Framework.

Iron Speed Designer also supports date validation in any localized format supported by the .NET Framework.  This is accomplished by server-side validation, rather than client-side validation, allowing validation to be tailored to the locale of the web server.

See Also

Customizing Error and Validation Message Strings

Enabling Language Support in Microsoft Windows

United States Phone Numbers, States and ZIP Codes

Creating a Multi-Lingual Application