Serilog_Localization 1.2.3

dotnet add package Serilog_Localization --version 1.2.3
                    
NuGet\Install-Package Serilog_Localization -Version 1.2.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Serilog_Localization" Version="1.2.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Serilog_Localization" Version="1.2.3" />
                    
Directory.Packages.props
<PackageReference Include="Serilog_Localization" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Serilog_Localization --version 1.2.3
                    
#r "nuget: Serilog_Localization, 1.2.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Serilog_Localization&version=1.2.3
                    
Install Serilog_Localization as a Cake Addin
#tool nuget:?package=Serilog_Localization&version=1.2.3
                    
Install Serilog_Localization as a Cake Tool

serilog-localization

A set of extensive methods that is able to complete the localization of serilog, using resx file to store localization strings

Usage

Step 1 : Create your localization resources

Create a folder in your project which contains the localization strings. For example, you can create Resources.resx(default),Resources.zh-CN.resx(Chinese) and Resources.en-US.resx.

Step 2 : Fill in your localization strings

You can use debug.,info.,verbose.,error.,warning.as key's prefix in default, or you can customize a prefix later

Step 3 : Initialize the Extension

You can enable localization like this

Log.Logger = new LoggerConfiguration()
    .WithLocalization(new ResourceManager(typeof(Your_Designer_Class),"zh-CN"))
    .MinimumLevel.Debug()
    .WriteTo.Console()
    .CreateLogger();

You can change locale while the program is running as this

CultureManager.Current = new CultureInfo("en-US");

And the culture will be changed immediately.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.3 221 24 days ago
1.0.0 106 24 days ago