Skip to main content

Satellite Resource Assemblies

  • 4 minutes to read

Satellite resource assemblies are the standard localization mechanism supported 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.

Obtain Satellite Assemblies

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:

  • C:\Program Files\DevExpress 24.1\Components\Bin\Framework\
  • C:\Program Files\DevExpress 24.1\Components\Bin\NetCore\

Component Installer

To obtain satellite assemblies for other cultures, use the DevExpress Localization Service that allows you to modify existing translations, compile, and download satellite assemblies.

Add Assemblies to Your Application

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.

Localization_ASP

Important

You must deploy the satellite resource assemblies to the production server.

Set an Application Culture

An application culture is defined by the Culture and UICulture properties. You can specify them in the following ways.

Localize an Application for a Specific Culture (regardless of operating system settings)

Set the Culture and UICulture properties to a certain culture ID. You can specify the properties at design time or runtime.

Design Time

  • To set the culture for all pages, add the globalization element to the Web.config file. Set the Culture and uiCulture attributes.

    <system.web>
        <globalization uiCulture="es" culture="es" />
        ...
    </system.web>
    
  • To set the culture for an individual page, set the Culture and UICulture attributes of the @ Page directive.

    <%@ Page UICulture="es" Culture="es" %>
    

Runtime

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;
     }
}
<style type="text/css">
     .lang-btn
     {
          text-decoration: none;
     }
</style>
...
<a class="lang-btn" href="Default.aspx?lang=en">
     <img src="Images/english.png" alt="English" />
</a>
<a class="lang-btn" href="Default.aspx?lang=de">
     <img src="Images/german.png" alt="Deutsch" />
</a>
<a class="lang-btn" href="Default.aspx?lang=es">
     <img src="Images/spanish.png" alt="Spanish" />
</a>

<dx:ASPxGridView ID="ASPxGridView1" ...
</dx:ASPxGridView>

The animation below shows the result.

Localization_InitializeCulture

Localize an Application for Numerous Cultures (based on operating system settings)

  • Provide multiple localization sources within your application for each culture to support.
  • Set the Culture and UICulture properties to auto.

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" %>

Create Culture-Independent Settings in an Application

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:

  1. Clone current CultureInfo.
  2. Change settings of the new CultureInfo object. Note that it is possible to copy settings from another culture instead of setting them manually.
  3. Assign the new CultureInfo object to CurrentCulture and CurrentUICulture properties.
protected void Page_Init(object sender, EventArgs e) {  
    CultureInfo newCulture = (CultureInfo)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;
}  

ASPxSpreadsheet Localization

The ASPxSpreadsheet control supports the standard localization mechanism. However, the control generates some elements (for instance, the context menu and its items) completely on the client and the solution with custom assemblies cannot be used here. For such elements, we have a separate localization mechanism. For more information, refer to the following section: Spreadsheet Localization.