Skip to content

suggetion use #55

Description

@gheith3

create blazor component 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationv6.0The biggest major update coming in May 2023

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions