Getting Started with WPF | ComponentOne Studio Edition
Localization / WPF Localization
In This Topic
    WPF Localization
    In This Topic

    You have several options to localize a WPF application. For best practices from Microsoft, see best practices for Globalization and Localization in WPF. When you use ComponentOne controls in your application, the localized resources are automatically included in your output based upon the published language you specify in your project’s settings. They will come from their installed location under C:\Program Files\ComponentOne\WPF Edition\bin, and do not need to be added manually to the project.

    Change the UI Culture of your application to the desired culture. One way of doing this is on the application's current thread. Add the below code to the MainWindow() constructor of your WPF application:

    Visual Basic
    Copy Code
    ' set language to Japanese
    Language = System.Windows.Markup.XmlLanguage.GetLanguage("ja-JP")
            
    ' set culture to Japanese ("ja-JP")
    Thread.CurrentThread.CurrentUICulture = New CultureInfo("ja-JP")
    
    C#
    Copy Code
    // set language to Japanese
    Language = System.Windows.Markup.XmlLanguage.GetLanguage("ja-JP");
    
    // set culture to Japanese ("ja-JP")Thread.CurrentThread.CurrentUICulture = new CultureInfo("ja-JP");
    

    Some controls have many baked in UI strings that can benefit from quick localization including C1Scheduler, C1DataGrid, C1DockControl, C1PdfViewer and C1RichTextBoxToolbar.

     

    See Also