mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fix i18n issues in error logging
This commit is contained in:
parent
42725102ee
commit
de539b6ad6
@ -29,6 +29,8 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
public static LaunchSettings LaunchSettings { get; private set; } = null!;
|
public static LaunchSettings LaunchSettings { get; private set; } = null!;
|
||||||
|
|
||||||
|
public static CultureInfo CurrentCulture { get; private set; } = CultureInfo.InvariantCulture;
|
||||||
|
|
||||||
public static BuildMetadataAttribute BuildMetadata = Assembly.GetExecutingAssembly().GetCustomAttribute<BuildMetadataAttribute>()!;
|
public static BuildMetadataAttribute BuildMetadata = Assembly.GetExecutingAssembly().GetCustomAttribute<BuildMetadataAttribute>()!;
|
||||||
public static string Version = Assembly.GetExecutingAssembly().GetName().Version!.ToString()[..^2];
|
public static string Version = Assembly.GetExecutingAssembly().GetName().Version!.ToString()[..^2];
|
||||||
|
|
||||||
@ -111,6 +113,9 @@ namespace Bloxstrap
|
|||||||
{
|
{
|
||||||
const string LOG_IDENT = "App::OnStartup";
|
const string LOG_IDENT = "App::OnStartup";
|
||||||
|
|
||||||
|
CultureInfo.DefaultThreadCurrentUICulture = CurrentCulture;
|
||||||
|
Thread.CurrentThread.CurrentUICulture = CurrentCulture;
|
||||||
|
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
|
|
||||||
Logger.WriteLine(LOG_IDENT, $"Starting {ProjectName} v{Version}");
|
Logger.WriteLine(LOG_IDENT, $"Starting {ProjectName} v{Version}");
|
||||||
|
@ -93,10 +93,11 @@
|
|||||||
|
|
||||||
public void WriteException(string identifier, Exception ex)
|
public void WriteException(string identifier, Exception ex)
|
||||||
{
|
{
|
||||||
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
|
|
||||||
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
|
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
|
||||||
|
|
||||||
WriteLine($"[{identifier}] {ex}");
|
WriteLine($"[{identifier}] {ex}");
|
||||||
|
|
||||||
|
Thread.CurrentThread.CurrentUICulture = App.CurrentCulture;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void WriteToLog(string message)
|
private async void WriteToLog(string message)
|
||||||
|
Loading…
Reference in New Issue
Block a user