

Use localization attributes to control localization instead of selectively omitting Uid properties on elements. Use localization comments to provide extra context for localizers. When you localize WPF–based applications, consider implementing these best practices:

For more information and an example, see Globalization Homepage Sample. This design enables you to change the FlowDirection of the Window and the navigation bar. When you create stand-alone navigation applications that are hosted outside a browser, set the StartupUri for your initial application to a NavigationWindow instead of to a page (for example, ). When you create navigation applications that may be localized in a culture that presents text in a right-to-left format, explicitly set the FlowDirection of every page to ensure the page does not inherit FlowDirection from the NavigationWindow.

By default, WPF uses the posite font in your Windows\Fonts directory. See Globalization for WPF for more information about setting the xml:lang Handling in XAML.Ĭreate a customized composite font to obtain better control of fonts that are used for different languages. For example, it changes the behavior of hyphenation, spell checking, number substitution, complex script shaping, and font fallback. The value of this property changes the behavior of several features in WPF. This attribute describes the culture of a specific element and its child elements. Extra space allows for possible overhanging characters.Įnable TextWrapping on TextBlock to avoid clipping. Provide extra space in margins because localized text often requires more space. Use SizeToContent and keep widths and heights set to Auto. When you create your UI by using XAML, you expose it through built-in localization APIs.Īvoid using absolute positions and fixed sizes to lay out content instead, use relative or automatic sizing. When you design a UI, consider implementing these best practices: You can make the most of the globalization and localization functionality that is built into WPF by following the UI design and localization-related tips that this section provides. Best Practices for Globalization and Localization in WPF
Localizer visualization how to#
For information about how to build and use LocBaml, see Localize an Application. These APIs power the LocBaml Tool Sample command-line tool. When you localize in WPF, you use the APIs in the namespace. Localization is the translation of application resources into localized versions for the specific cultures that the application supports. This overview introduces globalization and localization in WPF provides globalized design features, including automatic layout, satellite assemblies, and localized attributes and commenting. If you want your applications to reach a global audience, cost-effective localization of your product is one of the best and most economical ways to reach more customers. When you limit your product's availability to only one language, you limit your potential customer base to a fraction of our world's 7.5 billion population.
