-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b49a7cd
commit 566e36e
Showing
20 changed files
with
124 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="..\common.props" /> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Localization\Localization.csproj" /> | ||
<ProjectReference Include="..\Serialization\Serialization.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Ecng.Localization; | ||
|
||
public interface ILocalizer | ||
{ | ||
public string Localize(string enStr); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="..\common.props" /> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Common\Common.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
namespace Ecng.Localization; | ||
|
||
using Ecng.Common; | ||
|
||
public static class LocalizedStrings | ||
{ | ||
public static ILocalizer Localizer { get; set; } | ||
|
||
public const string InheritedKey = nameof(InheritedKey); | ||
public const string VerboseKey = nameof(VerboseKey); | ||
public const string DebugKey = nameof(DebugKey); | ||
public const string InfoKey = nameof(InfoKey); | ||
public const string WarningsKey = nameof(WarningsKey); | ||
public const string ErrorsKey = nameof(ErrorsKey); | ||
public const string OffKey = nameof(OffKey); | ||
public const string IdKey = nameof(IdKey); | ||
public const string LoggingKey = nameof(LoggingKey); | ||
public const string NameKey = nameof(NameKey); | ||
public const string LogSourceNameKey = nameof(LogSourceNameKey); | ||
public const string LogLevelKey = nameof(LogLevelKey); | ||
public const string LogLevelDescKey = nameof(LogLevelDescKey); | ||
|
||
public static string Inherited => Localize(nameof(Inherited)); | ||
public static string Verbose => Localize(nameof(Verbose)); | ||
public static string Debug => Localize(nameof(Debug)); | ||
public static string Info => Localize(nameof(Info)); | ||
public static string Warnings => Localize(nameof(Warnings)); | ||
public static string Errors => Localize(nameof(Errors)); | ||
public static string Off => Localize(nameof(Off)); | ||
public static string Id => Localize(nameof(Id)); | ||
public static string Logging => Localize(nameof(Logging)); | ||
public static string Name => Localize(nameof(Name)); | ||
public static string LogSourceName => Localize(nameof(LogSourceName)); | ||
public static string LogLevel => Localize(nameof(LogLevel)); | ||
public static string LogLevelDesc => Localize(nameof(LogLevelDesc)); | ||
|
||
public static string Localize(this string enStr) | ||
=> (Localizer?.Localize(enStr)).IsEmpty(enStr); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.