aspnetmvc-402213-common-features-localization-satellite-resource-assemblies.md
Satellite resource assemblies are the standard localization mechanism provided by the .NET Framework to build multi-language applications. Refer to the following topic in the Visual Studio documentation to learn more about localization: Develop globalized and localized apps.
DevExpress Component Installer allows you to install satellite resource assemblies for the following cultures: German (de), Spanish (es), and Japanese (ja). Select the Community-Sourced Localization (for de, es, ja) checkbox to place the assemblies in the following folders:
To obtain satellite assemblies for other cultures, use the DevExpress Localization Service that allows you to modify existing translations, compile, and download satellite assemblies.
In the bin directory of your application, create a subfolder for every added culture. The subfolder’s name is the language code (for example, “ de “). Copy satellite assemblies to the corresponding subfolder.
The following diagram illustrates where satellite assemblies should be placed within your application’s directory.
Important
You must deploy the satellite resource assemblies to the production server.
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.
Add the globalization element to the Web.config file. Set the Culture and uiCulture attributes.
<globalization uiCulture="es" culture="es" />
...
Run Demo: Grid View - Localization
To switch a culture at runtime, specify the CurrentUICulture and CurrentCulture properties. One of the ways to adjust these properties across the entire application is handling the HttpApplication.AcquireRequestState event in the Global.asax file.
protected void Application_AcquireRequestState(object sender, EventArgs e) {
CultureInfo ci = new CultureInfo("de-DE");
Thread.CurrentThread.CurrentUICulture = ci;
Thread.CurrentThread.CurrentCulture = ci;
}
Protected Sub Application_AcquireRequestState(ByVal sender As Object, ByVal e As EventArgs)
Dim ci As New CultureInfo("de-DE")
Thread.CurrentThread.CurrentUICulture = ci
Thread.CurrentThread.CurrentCulture = ci
End Sub
See also: How to change the current culture at runtime
You can specify culture-independent settings in your application. For instance, always show currency in euros. To change settings without changing the current culture, follow the steps below:
CultureInfo.CultureInfo object. Note that it is possible to copy settings from another culture instead of setting them manually.CultureInfo object to CurrentCulture and CurrentUICulture properties.System.Globalization.CultureInfo newCulture = (System.Globalization.CultureInfo)System.Globalization.CultureInfo.CurrentCulture.Clone();
// Use the dot symbol as a thousand separator
newCulture.NumberFormat.NumberGroupSeparator = ".";
// Use the comma symbol as a decimal separator
newCulture.NumberFormat.NumberDecimalSeparator = ",";
// Show currency in euros
newCulture.NumberFormat.CurrencySymbol = "€";
// Copy date-time format from the en-us culture
newCulture.DateTimeFormat = new CultureInfo("En-US").DateTimeFormat;
System.Threading.Thread.CurrentThread.CurrentCulture = newCulture;
System.Threading.Thread.CurrentThread.CurrentUICulture = newCulture;
Dim newCulture As System.Globalization.CultureInfo = DirectCast(System.Globalization.CultureInfo.CurrentCulture.Clone(), System.Globalization.CultureInfo)
' Use the dot symbol as a thousand separator
newCulture.NumberFormat.NumberGroupSeparator = "."
' Use the comma symbol as a decimal separator
newCulture.NumberFormat.NumberDecimalSeparator = ","
' Show currency in euros
newCulture.NumberFormat.CurrencySymbol = "€";
' Copy date-time format from the en-us culture
newCulture.DateTimeFormat = (New CultureInfo("En-US")).DateTimeFormat
System.Threading.Thread.CurrentThread.CurrentCulture = newCulture
System.Threading.Thread.CurrentThread.CurrentUICulture = newCulture