Back to Devexpress

How to: Create a Custom Translation Provider for the Localization Tool

expressappframework-113310-localization-how-to-create-a-custom-translation-provider-for-the-localization-tool.md

latest2.6 KB
Original Source

How to: Create a Custom Translation Provider for the Localization Tool

  • Feb 20, 2026
  • 3 minutes to read

The Localization Tool utilizes the Microsoft Translator as the translation provider. However, one of the notable features of our localization tool is the capability to use custom translation services. That means that you can use alternative translators. In this example, custom translation provider implementation is demonstrated.

To create a custom translation provider, you need to create and register a class, implementing the ITranslatorProvider interface. As an alternative to implementing it from scratch, you can create a descendant of the TranslatorProviderBase class, which already encompasses a good deal of functionality. This class also collects localized values in blocks to shorten the translation based on the online translation services. In this example, we will utilize the second approach.

The TranslatorProviderBase class descendant should implement some methods and properties of the ITranslatorProvider interface, which are not implemented by the base class.

Additionally, overriding the ITranslatorProvider.Translate method is required.

Perform the following steps to implement the translation provider.

  • Add the following class into the platform-agnostic module project (MySolution.Module), or add a new module to your solution and implement this class in it.

  • Modify the module’s constructor to register a custom translation provider class.

  • Rebuild your solution, and this custom translation provider will replace the default provider used by the Localization Tool in Visual Studio and at runtime.

See Also

ITranslatorProvider

Localization Tool