Skip to main content

Component Reference

This page provides a quick reference for the main Translazor Blazor components.

Use it when you already understand the basic setup and need to check which component to use, what parameters it accepts, and where it should be placed.

Components overview

ComponentPurpose
BlazorTranslatorProvides translation context and coordinates page/component translation.
TranslatableTextTranslates visible page text.
TranslatedHeadTranslates SEO metadata such as page title and meta description.
LanguageSelectorDisplays a language selector UI.
LanguageNavigationSelectorDisplays a language selector that changes the URL language segment.
TranslationAdminProvides the built-in admin interface for managing translation overrides.

BlazorTranslator

BlazorTranslator is the main wrapper component used to initialize Translazor translation behavior for a page or layout area.

It provides translation context to child components such as TranslatableText, TranslatedHead, and language selectors.

Basic usage

In Routes.razor

<BlazorTranslator Mode="LanguageInitMode.FromUrl" UpdatePageDirection="false" >
<Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData">
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>
</BlazorTranslator>

More details: Translating Head and SEO Metadata

In your page:

  1. Translate header:
<TranslatedHead TitleKey="Home.Title"
Title="Home"
MetaDescriptionKey="Home.MetaDescription"
MetaDescription="Test application" />
ParameterTypeRequiredDescription
TitleKeystringYesTranslation key for the page title.
TitlestringYesDefault page title shown before translation is loaded or when translation is unavailable.
MetaDescriptionKeystringYesTranslation key for the meta description.
MetaDescriptionstringYesTranslDefault meta description shown before translation is loaded or when translation is unavailable.
  1. Translate body:
<h1>
<TranslatableText Key="Home.Message" Text="Hello, world!" />
</h1>

<TranslatableText Key="Home.Body" Text="Welcome to your new app." />
ParameterTypeRequiredDescription
KeystringYesUnique translation key used to identify the text.
TextstringYesDefault text shown before translation is loaded or when translation is unavailable.

More details: Translating Head and SEO Metadata