Use null as the default locale, which resolves to the current system default locale (#1185)

This commit is contained in:
Oleksii Holub
2024-01-15 23:58:28 +02:00
committed by GitHub
parent 982ba6a76c
commit 057beaacd6
5 changed files with 26 additions and 18 deletions

View File

@@ -8,6 +8,7 @@ using DiscordChatExporter.Core.Discord.Data;
using DiscordChatExporter.Core.Exporting.Filtering;
using DiscordChatExporter.Core.Exporting.Partitioning;
using DiscordChatExporter.Core.Utils;
using DiscordChatExporter.Core.Utils.Extensions;
namespace DiscordChatExporter.Core.Exporting;
@@ -39,9 +40,9 @@ public partial class ExportRequest
public bool ShouldReuseAssets { get; }
public string Locale { get; }
public string? Locale { get; }
public CultureInfo CultureInfo { get; }
public CultureInfo? CultureInfo { get; }
public bool IsUtcNormalizationEnabled { get; }
@@ -58,7 +59,7 @@ public partial class ExportRequest
bool shouldFormatMarkdown,
bool shouldDownloadAssets,
bool shouldReuseAssets,
string locale,
string? locale,
bool isUtcNormalizationEnabled
)
{
@@ -83,7 +84,7 @@ public partial class ExportRequest
? FormatPath(assetsDirPath, Guild, Channel, After, Before)
: $"{OutputFilePath}_Files{Path.DirectorySeparatorChar}";
CultureInfo = CultureInfo.GetCultureInfo(Locale);
CultureInfo = Locale?.Pipe(CultureInfo.GetCultureInfo);
}
}