Localizing ASP.NET Controls via Global Resources (Obsolete from 11.2)
- 3 minutes to read
Starting with version 11.2, we recommend using a universal localization approach for all of our controls.
See the Localizing ASP.NET Controls via Satellite Resource Assemblies topic to learn more.
This topic describes the native ASP.NET approach. It is included in the documentation for compatibility purposes.
DevExpress ASP.NET controls can obtain content (e.g., captions, messages, etc.) based on the preferred language setting for the browser, or based on the user's explicit language of choice. Content is referred to as "resources", and it can be stored in resource files. A resource file is an XML file that contains strings that can be translated into different languages. Resource files in ASP.NET have a .resx extension. Each localized resource file contains key/value pairs. For detailed information, see ASP.NET Web Page Resources Overview.
Since a resource file is an XML file, you can easily customize string values using a text editor.
All DevExpress ASP.NET products that can be localized are shipped with resource files: a default resource file and numerous localized versions (one for each culture). The default resource files (also called "fallback") are listed below.
DevExpress ASP.NET Product
Default Resource File
A localized resource file name consists of the corresponding default name and a culture name (see the National Language Support (NLS) API Reference topic in MSDN). For example:
- DevExpress_Web_v12_2.resx - The default resource file for DevExpress ASP.NET controls.
- DevExpress_Web_v12_2.de.resx - A resource file for the German localization of DevExpress ASP.NET controls.
For a collection of default and translated resources, refer to the Localized resources for DevExpress ASP.NET controls article in our Knowledge Base. Find the Attachments section with a list of available packs, different for specific versions of DevExpress components. Use these links to download a package with resources appropriate for your component version.
How to Add Global Resources to a Web Site
Before localizing your website, copy all the required localized resource files, along with their default versions, from the downloaded package to the App_GlobalResources folder. This folder can be created as shown below.
Note that if only localized resource files are contained in this folder (e.g. DevExpress_Web_v12_2.de.resx), without the corresponding default resource file (e.g. DevExpress_Web_v12_2.resx), App_GlobalResources-related exceptions will occur.
When all required resource files are copied to the App_GlobalResources folder, the localization can be specified via the UICulture property. To learn more, see the How to: Set a Culture for an ASP.NET Web Page topic.