WPF Localization
Lingobit Localizer localizes WPF applications on .NET Framework 4.8 and .NET 5–10 from the compiled assemblies. It reads the BAML resources (the compiled XAML), shows the windows in a preview, and writes the translations into satellite assemblies.
What to add
Add the assembly that contains the windows. For WPF on .NET 5–10 this is MyApp.dll; MyApp.exe only starts it. Resources split across several assemblies are supported; add each assembly with windows or resource dictionaries.
Create Localized Files writes satellite assemblies such as de-DE\MyApp.resources.dll. See Satellite Assembly Output.
Preview
Select a window, page, or user control to see it in the preview with the current translation. The preview loads the resource dictionaries of the application, but does not run its startup code, commands, or event handlers.
Click a control to select its text in the Translation Editor; the item selected in the table is highlighted in the preview.
Click a tab header to switch tabs. When you select a string on a hidden tab, the preview opens the tabs that contain it.
Combo boxes, menus, context menus, and toolbar overflow open as popups with their texts. Press Escape to close a popup.
Access keys are shown with
_, as in XAML:_File.
The preview is for checking text and layout; it is not a full WPF designer. Check the layout of the translated windows by eye: WPF changes the size of controls at run time, so text that does not fit is not reported automatically. If a window cannot be loaded, for example because a resource or a dependency is missing, Output shows the error with the name of the resource or assembly.
The WPF > View page of the properties turns the preview on and off.
Prepare the application
Lingobit Localizer identifies WPF elements by their x:Uid. Add Uids before you start, with the MSBuild target updateuid, and check them with checkuid:
msbuild /t:updateuid MyProject.csproj msbuild /t:checkuid MyProject.csproj
Do not change Uids after localization has started, and do not duplicate them when you copy XAML.
Use localization attributes to mark text that must not be translated.
Give controls automatic sizes and extra space; localized text is often longer.
For right-to-left languages, set
FlowDirectionexplicitly.
Elements without a Uid are reported in Output.
See also WPF Property Filter, WPF Category Filter, and .NET Parser. The WPF Localization sample is on the start page.