Skip to main content
All docs
V23.2

XtraLocalizer.UserResourceManager Property

Gets or sets the resource manager.

Namespace: DevExpress.Utils.Localization

Assembly: DevExpress.Data.v23.2.dll

NuGet Package: DevExpress.Data

Declaration

public static ResourceManager UserResourceManager { get; set; }

Property Value

Type Description
ResourceManager

The resource manager.

Remarks

The XtraLocalizer class allows you to create and use RESX files with custom localization strings. Follow the steps below:

  1. Create separate RESX files with translated resource strings for each of the supported cultures/languages.

    Create RESX Files

  2. Add RESX files to your project.

    Add RESX Files to the Project

  3. Rebuild the project.

  4. Use the UserResourceManager property to initialize the resource manager. You can obtain the required object reference by using the folder and file name (namespace and class name) you chose for the custom resource file. Compare the highlighted code line to the Solution Explorer screenshot above.

    static void Main() {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        CultureInfo culture = CultureInfo.CreateSpecificCulture("de-DE");
        Thread.CurrentThread.CurrentUICulture = culture;
        Thread.CurrentThread.CurrentCulture = culture;
        CultureInfo.DefaultThreadCurrentCulture = culture;
        CultureInfo.DefaultThreadCurrentUICulture = culture;
        XtraLocalizer.UserResourceManager = Localization.myResources.ResourceManager;
        Application.Run(new Form1());
    }
    
See Also