Localization in Blazor Maps Component

4 Nov 20251 minute to read

The Blazor Maps component supports localization to display content in any language by integrating localized text resources. Static text elements, such as zoom toolbar tooltips and placeholder text for tile images that fail to load, can be translated into various languages (for example, Arabic, German, and French) by defining the appropriate locale value. To manage language-specific content efficiently, the localization process can use .resx files, enabling consistent maintenance of translations. This feature enhances accessibility by allowing interaction with the Maps component in the preferred language and supports integration in globally targeted applications.

Culture-specific resource files can be added using .resx files in the application. For implementation details, refer to the Blazor Localization topic: Blazor Localization.

The table below lists the locale keywords and the corresponding text used in the Blazor Maps component. These keywords represent various UI elements, such as tooltips for the zoom toolbar including zoom, zoom in/out, pan, and reset actions. By defining these locale keys, the text displayed in different languages can be customized.

Locale keywords Text to display
Maps_Zoom Zoom
Maps_ZoomIn Zoom in
Maps_ZoomOut Zoom out
Maps_Reset Reset
Maps_Pan Pan
Maps_ImageNotFound Image Not Found

These translations enable the Maps component to adapt to the preferred language, improving accessibility and usability.

The image below illustrates tooltip text for the zoom toolbar in different cultures.

Blazor Maps with Localization