Back to Devexpress

XtraLocalizer.EnableTraceSource(String) Method

corelibraries-devexpress-dot-utils-dot-localization-dot-xtralocalizer-dot-enabletracesource-x28-system-dot-string-x29.md

latest3.9 KB
Original Source

XtraLocalizer.EnableTraceSource(String) Method

Allows the UI Localization Client to attach to the application.

Namespace : DevExpress.Utils.Localization

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public static bool EnableTraceSource(
    string applicationName = null
)
vb
Public Shared Function EnableTraceSource(
    applicationName As String = Nothing
) As Boolean

Optional Parameters

NameTypeDefaultDescription
applicationNameStringnull

The application name. Specify this parameter if the UI Localization Client cannot automatically obtain the application name.

|

Returns

TypeDescription
Boolean

true if the application has been detected (the trace source was created); otherwise, false.

|

Remarks

The UI Localization Client is a cross-platform utility sipped as part of DevExpress Subscriptions that allows you to quickly identify non-translated strings of DevExpress UI controls and translate them during a debug session. The utility automatically generates a RESX file(s) with translated resources and adds it to the project.

Read the following topic for additional information: DevExpress UI Localization Client (Maintenance Mode).

Example (WinForms)

The following example demonstrates how to configure the WinForms application:

csharp
internal static class Program {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main() {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        CultureInfo culture = CultureInfo.CreateSpecificCulture("de-DE");
        CultureInfo.DefaultThreadCurrentCulture = culture;
        CultureInfo.DefaultThreadCurrentUICulture = culture;
        // Do not remove the following line when using the UI Localization Client.
        DevExpress.Utils.Localization.XtraLocalizer.EnableTraceSource();
        Application.Run(new Form1());
    }
}
vb
Friend Module Program
    ''' <summary>
    ''' The main entry point for the application.
    ''' </summary>
    <STAThread>
    Sub Main()
        Application.EnableVisualStyles()
        Application.SetCompatibleTextRenderingDefault(False)
        Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture("de-DE")
        CultureInfo.DefaultThreadCurrentCulture = culture
        CultureInfo.DefaultThreadCurrentUICulture = culture
        ' Do not remove the following line when using the UI Localization Client.
        DevExpress.Utils.Localization.XtraLocalizer.EnableTraceSource()
        Application.Run(New Form1())
    End Sub
End Module

See Also

DevExpress UI Localization Client (Maintenance Mode)

EnterTraceMode

XtraLocalizer Class

XtraLocalizer Members

DevExpress.Utils.Localization Namespace