Skip to main content

Localization

Wisej.NET fully supports localization using .NET and Visual Studio standard localization features.

{% file src="../assets/wisej.localization.zip" caption="Download Wisej.Localization.zip" %}

Localizing the UI

All top-level controls in Wisej.NET support UI localization.

To enable localization features for a Form, Page, UserControl, or Desktop component:

  1. In design mode, set the Localizable property to true
  2. Once enabled, you can switch languages in the designer

Use the Language dropdown property to select the language for localization:

Language selection dropdown

UI localization allows changing multiple properties per language switch, commonly:

  • Size
  • Location
  • Text
  • Colors
  • Images

Localizing the System

Wisej.NET supports full localization of system resources including:

  • MessageBox buttons
  • Calendar control labels (month/day names)
  • Standard numeric, percentage and currency formatting/parsing

Built-in Formats

  • Numeric, Percentage, Date, and Currency

    Handled automatically for all supported languages worldwide.

  • Date Labels: Months and Day Names

    Handled automatically for all supported languages worldwide.

  • System Resources

    Wisej.NET system resources are localized in:

    • English
    • German
    • French
    • Italian
    • Turkish
    • Spanish
    • Portuguese

    For other languages, create a Resources-[LANG].resx file in either:

    • Root project folder
    • /Resources folder

    Add localization labels as needed. See How to: Create a Localized Resource File.

    LabelDescriptionDefault Value
    $OkOK Button in MessageBox/system dialogsOK
    $CancelCancel Button in MessageBox/system dialogsCancel
    $YesYes Button in MessageBox/system dialogsYes
    $NoNo Button in MessageBox/system dialogsNo
    $RetryRetry Button in MessageBox/system dialogsRetry
    $IgnoreIgnore Button in MessageBox/system dialogsIgnore
    $AbortAbort Button in MessageBox/system dialogsAbort
    $Next yearNext-year navigation tooltip in calendar controlsNext Year
    $Next monthNext-month navigation tooltip in calendar controlsNext Month
    $Last yearLast-year navigation tooltip in calendar controlsLast Year
    $Last monthLast-month navigation tooltip in calendar controlsLast Month
    $OfflineOffline connectivity loss notificationOffline

Localizing Resources

Beyond system localization, you'll likely need to localize application resources (strings, images, etc.).

Create .resx files as needed using the approach above. See How to: Create a Localized Resource File.

Use the ResourceManager class to retrieve localized values. Wisej.NET handles thread culture switching for client requests.

var RS = new ResourceManager("Localization.Resources", this.GetType().Assembly);
var title = RS.GetString("Title");

Detecting/Switching Browser Language

Wisej.NET automatically detects browser language and switches application/system resources accordingly.

You can force a specific language for the application (user session) by:

  1. Setting the culture property in Default.json (default is "auto"). See Configuration.
  2. Using one of these methods:

When current culture changes from the session's initial culture, Wisej.NET raises the Application.CultureChanged event.

warning

Designer-localized controls update only at creation. No built-in mechanism exists to change already-created controls. To update existing controls either:

  • Re-create the container and call InitializeControl
  • Write custom code to reapply resources