.netCoders Contact Us
Search:

Globalization

When developing an application that will be distributed globally, you have to consider the process of globalization (Globalization is the process of designing and developing an application that supports localized user interfaces and regional data for users in multiple cultures.) and localization (Localization is the process of translating an application's resources into localized versions for each culture that the application will support.)

For localization, you can create separate resource files for each locale in what are known as Satellite Assemblies. See out section on Satellite Assemblies for more information.

Localizable Forms

In the Visual Studio.NET Forms Designer, the Localizable property indicates whether localizable code will be generated for an object (eg. a form). If this property is set, the properties for the object (and contained objects) will be stored in the resource file, rather than into the code. The following screen shots show the resx file from first a form with the Localizable property set to False, and then second with the same form's property set to True. Notice in the second screenshot that the properties for the controls on the form are stored in the resource file.

With the properties in the resource file, you can use a tool such as the Windows Resource Localization Editor (see below) to modify the .resources and .resx files.

Windows Resource Localization Editor

Another tool in the .NET Framework is the Windows Resource Localization Editor (WinRes.exe). This is a Windows-based editor that can be used to set localization properties for multiple cultures. Using this tool, you can edit .resources and .resx files, but cannot add or remove resources. Because of this, multiple people can work on an application's localization, and keep the resources consistent.

Thw Windows Resource Localization Editor is installed to this location by default:
\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin

The RightToLeft Property

Unlike English, some languages such as Hebrew and Arabic are written right-to-left. One of the properties of Windows controls and forms is the RightToLeft property, of the RightToLeft enumeration type. The possible values for this enumeration are:

Member name Description
Inherit The direction the text read is inherited from the parent control.
No The text reads from left to right. This is the default.
Yes The text reads from right to left.

The default value for the RightToLeft property is Inherit, so you can set the RightToLeft property of the Form, and all child controls will inherit this value.

The RightToLeft property does not just affect text however. When the property is set to RightToLeft.Yes, some additional UI changes take place. Here are some examples:

  • Vertical Scrollbars are on the left side. Horizontal scrollbars scroll from right to left.
  • The Form title is right-aligned in the title bar
  • Menu items start from the right, and go to the left


Right-aligned menu