How to localize

The WPF HTML Editor ships with a built-in localization layer that translates the entire user interface - toolbar tooltips, dialog titles and labels, context menu items, status messages, and validation prompts - to one of fourteen supported languages. In almost every case you do not need to override individual strings: a single assignment to the Language property switches the whole UI at once.

Setting the UI language

The Language property on WpfHtmlEditor is a dependency property of type EditorLanguage. Assign it once after the editor is initialized (or bind it from your view model) and every visible piece of UI text re-renders in that language - no resource files to ship, no per-label code to write.

using SpiceLogic.HtmlEditor.WPF;
using SpiceLogic.HtmlEditor.Resources.Localization;

// Switch the entire editor UI to German.
editor.Language = EditorLanguage.German;

You can also set the language declaratively in XAML:

<wpfEditor:WpfHtmlEditor x:Name="editor" Language="French" />

Visual Studio property window showing the Language dropdown listing all EditorLanguage enum values for the WPF HTML Editor

The full set of supported EditorLanguage values is:

  • EnglishUs - English (United States), default
  • EnglishGb - English (Great Britain)
  • German - German (Germany)
  • Dutch - Dutch (Netherlands)
  • French - French (France)
  • Spanish - Spanish (Spain)
  • Italian - Italian (Italy)
  • Danish - Danish (Denmark)
  • Polish - Polish (Poland)
  • Norwegian - Norwegian Bokmal (Norway)
  • Czech - Czech (Czech Republic)
  • Swedish - Swedish (Sweden)
  • PortugueseBr - Portuguese (Brazil)
  • PortuguesePt - Portuguese (Portugal)

The property is observable, so you can change it at runtime - for example in response to a user picking a language from a settings menu - and the editor will refresh its UI in place without losing the document or selection.

WPF HTML Editor with the Language property set to German showing translated toolbar tooltips

Localizing the spell checker

The spell checker has its own language setting because you may want, for example, a German UI but an English-language document being checked. It lives on the spell-check options object as SpellCheckOption.SpellCheckLanguage and uses a separate enum, SpellCheckLanguage.

The default value is SpellCheckLanguage.SameAsEditorLanguage, which automatically follows the editor's Language property - so for the typical case you do not have to set it at all. Override it only when you want the spell checker to use a different dictionary than the UI:

using SpiceLogic.HtmlEditor.Abstractions.Entities.SpellCheck;
using SpiceLogic.HtmlEditor.Resources.Localization;

// German UI, but spell-check the document text against a US English dictionary.
editor.Language = EditorLanguage.German;
editor.SpellCheckOptions.SpellCheckLanguage = SpellCheckLanguage.EnglishUs;

WPF HTML Editor showing the spell checker using a different language than the UI via SpellCheckOption.SpellCheckLanguage

Bundled Hunspell dictionaries cover the same fourteen languages as the UI. If you need a language that is not in the enum, point the editor at a custom Hunspell .aff/.dic pair via the dictionary file path option - that always takes precedence over the bundled dictionaries.

Customizing individual labels

If the built-in translations do not cover a string you care about - for example you want to rename a context-menu item, change the wording of a built-in dialog, or expose your own brand vocabulary in the toolbar - you can fall back to overriding individual UI elements.

The two extension points that cover virtually every customizable label are documented on their own pages:

  • Replace any built-in dialog with your own WPF window - see Replacing the default Dialogs (page 165). Useful when you want a dialog whose layout, captions, or behavior differs from the shipped one.
  • Replace the right-click context menu with your own items and handlers - see Using your own Context Menu (page 163). Useful when you want to add product-specific commands or rename the standard ones.

WPF HTML Editor right-click context menu rendered in Spanish via the Language property

For most applications, setting Language alone is enough. Use the manual-override path only for the residual strings the built-in localization does not reach.

Last updated on May 12, 2026