Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

chrissainty/BlazoredLocalisation

Repository files navigation

BlazoredLocalisation

A library to provide localisation in client-side Blazor applications

NuGet

Installing

You can install from Nuget using the following command:

Install-Package BlazoredLocalisation

Or via the Visual Studio package manger.

Setup

You just need to add app.UseBrowserLocalisation(); in your startup.cs file as per the example below.

public void Configure(IBlazorApplicationBuilder app)
{
    app.UseBrowserLocalisation();
    app.AddComponent<App>("app");
}

This will set the CultureInfo.CurrentCulture and CultureInfo.CurrentUICulture for your Blazor application based on the language settings of the clients browser.

Screenshot of BlazorLocalisation