Open gheith3 opened 1 year ago
create blazor component AppTranslation.razor
AppTranslation.razor
@if (Values is null) { @languageContainer.Keys[Key] } else { @languageContainer.Keys[Key, Values] } @code { [Parameter] public required string Key { get; set; } [Parameter] public Object? Values { get; set; } protected override void OnInitialized() { languageContainer.InitLocalizedComponent(this); base.OnInitialized(); } }
then in any where inside your project you can use it like
<AppTranslation Key="HomePage:Title" />
by this way all text will update immediately when you change lang
create blazor component
AppTranslation.razor
then in any where inside your project you can use it like
<AppTranslation Key="HomePage:Title" />
by this way all text will update immediately when you change lang