aspnet-3872-localization-global-resources.md
This topic describes the native ASP.NET localization technique and contains download links to localized resources for DevExpress ASP.NET controls.
Tip
In v12.1 and higher, we recommend that you localize your application with the Satellite Resource Assemblies.
You can download default and translated resources from the following link:
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 name/value pairs. You can use a text editor to customize a resource file’s string values.
Refer to the following topic in the Visual Studio documentation to learn more about global resource files: ASP.NET Web Page Resources Overview.
DevExpress ASP.NET products ship with a default resource file and numerous localized resource files (one for each culture).
List of default resource files
|
Product
|
Default Resource File
| | --- | --- | |
|
DevExpress_Web_ASPxGridView_v20.1.resx
| |
|
DevExpress_Web_v20.1.resx
| |
|
DevExpress_Web_ASPxEditors_v20.1.resx
| |
|
DevExpress_Web_ASPxDiagram_v20.1.resx
| |
|
DevExpress_Web_v20.1.resx
| |
|
DevExpress_Web_ASPxGantt_v20.1.resx
| |
|
DevExpress_Web_ASPxGridView_v20.1.resx
| |
|
DevExpress_Web_v20.1.resx
| |
|
DevExpress_Web_ASPxHtmlEditor_v20.1.resx
| |
|
DevExpress_Web_v20.1.resx
| |
|
DevExpress_Web_ASPxPivotGrid_v20.1.resx
| |
|
DevExpress_XtraReports_v20.1_Web.resx
| |
|
DevExpress_Web_ASPxRichEdit_v20.1.resx
| |
|
DevExpress_Web_ASPxScheduler_v20.1.resx
| |
|
DevExpress_Web_v20.1.resx
| |
|
DevExpress_Web_ASPxSpellChecker_v20.1.resx
| |
|
DevExpress_Web_ASPxSpreadsheet_v20.1.resx
| |
|
DevExpress_Web_ASPxTreeList_v20.1.resx
| |
|
DevExpress_Web_ASPxGridView_v20.1.resx
|
A localized resource file name consists of the corresponding default name and a culture name, such as the following:
DevExpress curates resources for the following cultures: English (en) (default), German (de), Japanese (ja), Russian (ru), and Spanish (es).
Resources for other cultures are generated by the DevExpress developer community. You should verify accuracy before incorporating resources into your software project.
List of available cultures
Chinese (Simplified) [zh-CHS] (prior v12.1 - see “zh-Hans” vs “zh-CHS” and “zh-Hant” vs “zh-CHT”)
Chinese [zh-Hans] v12.1+
Chinese [zh-Hant] v12.1+
Croatian [hr]
Czech [cs]
Danish [da]
French [fr]
German [de]
Greek [el]
Hungarian [hu]
Italian [it]
Polish [pl]
Portuguese (Brazil) [pt-BR]
Portuguese (Portugal) [pt-PT]
Romanian [ro]
Russian [ru]
Slovak [sk] v12.1+ Slovenian [sl]
Spanish [es]
Swedish [sv] v11.2+
Turkish [tr] v14.2+
Dutch - The Netherlands [nl]
Norwegian [no]
Japanese [ja] v11.1+
Copy localized and corresponding default resource files to the App_GlobalResources folder.
Note that if the App_GlobalResources folder contains only a localized resource file (DevExpress_Web_v20.1.de.resx), without the corresponding default resource file (DevExpress_Web_v20.1.resx), an exception will occur.
An application culture is defined by the Culture and UICulture properties. You can specify them in the following ways.
Set the Culture and UICulture properties to a certain culture ID. You can specify the properties at design time or runtime.
To set the culture for all pages, add the globalization element to the Web.config file. Set the Culture and uiCulture attributes.
To set the culture for an individual page, set the Culture and UICulture attributes of the @ Page directive.
Override the InitializeCulture() method to specify the Culture and UICulture properties for the page.
protected override void InitializeCulture() {
var lang = Request.QueryString["lang"];
if (!string.IsNullOrEmpty(lang)) {
Culture = lang;
UICulture = lang;
}
}
Protected Overrides Sub InitializeCulture()
Dim lang = Request.QueryString("lang")
If (Not String.IsNullOrEmpty(lang)) Then
Culture = lang
UICulture = lang
End If
End Sub
<style type="text/css">
.lang-btn
{
text-decoration: none;
}
</style>
...
<a class="lang-btn" href="Default.aspx?lang=en">
</a>
<a class="lang-btn" href="Default.aspx?lang=de">
</a>
<a class="lang-btn" href="Default.aspx?lang=es">
</a>
<dx:ASPxGridView ID="ASPxGridView1" ...
</dx:ASPxGridView>
The animation below shows the result.
The application automatically determines the operating system’s culture information and loads the appropriate assemblies for this culture. You can set the Culture and UICulture properties in any of the ways described above.
<%@ Page UICulture="auto" Culture="auto" %>