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
| Component | Purpose |
|---|---|
BlazorTranslator | Provides translation context and coordinates page/component translation. |
TranslatableText | Translates visible page text. |
TranslatedHead | Translates SEO metadata such as page title and meta description. |
LanguageSelector | Displays a language selector UI. |
LanguageNavigationSelector | Displays a language selector that changes the URL language segment. |
TranslationAdmin | Provides 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:
- Translate header:
<TranslatedHead TitleKey="Home.Title"
Title="Home"
MetaDescriptionKey="Home.MetaDescription"
MetaDescription="Test application" />
| Parameter | Type | Required | Description |
|---|---|---|---|
TitleKey | string | Yes | Translation key for the page title. |
Title | string | Yes | Default page title shown before translation is loaded or when translation is unavailable. |
MetaDescriptionKey | string | Yes | Translation key for the meta description. |
MetaDescription | string | Yes | TranslDefault meta description shown before translation is loaded or when translation is unavailable. |
- Translate body:
<h1>
<TranslatableText Key="Home.Message" Text="Hello, world!" />
</h1>
<TranslatableText Key="Home.Body" Text="Welcome to your new app." />
| Parameter | Type | Required | Description |
|---|---|---|---|
Key | string | Yes | Unique translation key used to identify the text. |
Text | string | Yes | Default text shown before translation is loaded or when translation is unavailable. |
More details: Translating Head and SEO Metadata