Skip to main content

Posts

Showing posts from June, 2023

Localizing an ASP.NET Core Blazor website using VS Code

Localizing an ASP.NET Core Blazor website using VS Code The standard way of localizing .NET applications is using .resx files, which is very easy to do in Visual Studio. It’s also possible to do this using Visual Studio Code, however this tooling doesn’t come by default with the C# extension for Visual Studio Code, which means you need an extension and a bit more work. In this tutorial I will assume that you have run the dotnet new blazorserver command, which will bootstrap a Blazor project for you. IDE setup All you need to do is to install the ResX Editor extension by Dominic Vonk, which will allow you to edit .resx files in VS Code. Create resource files Now, create a Resources folder on your project and create a file called SharedResources.resx . You could also create one resource file per page, e.g. Home.resx , Register.resx , etc. You can now add as many keys to this file as you wish. For each .resx file you make, you must also create a .cs file with the same name...