Serilog_Localization 1.2.3
dotnet add package Serilog_Localization --version 1.2.3
NuGet\Install-Package Serilog_Localization -Version 1.2.3
<PackageReference Include="Serilog_Localization" Version="1.2.3" />
<PackageVersion Include="Serilog_Localization" Version="1.2.3" />
<PackageReference Include="Serilog_Localization" />
paket add Serilog_Localization --version 1.2.3
#r "nuget: Serilog_Localization, 1.2.3"
#addin nuget:?package=Serilog_Localization&version=1.2.3
#tool nuget:?package=Serilog_Localization&version=1.2.3
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 | Versions 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. |
-
net8.0
- Serilog (>= 4.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.