mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-28 05:34:12 -04:00
Simplify anti-russian checks
This commit is contained in:
parent
b672c30071
commit
ec840e76ae
2 changed files with 6 additions and 28 deletions
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace DiscordChatExporter.Cli;
|
||||
|
@ -19,19 +18,9 @@ public static class Sanctions
|
|||
if (isSkipped)
|
||||
return;
|
||||
|
||||
var isSanctioned = new[]
|
||||
{
|
||||
CultureInfo.CurrentCulture,
|
||||
CultureInfo.CurrentUICulture,
|
||||
CultureInfo.InstalledUICulture,
|
||||
CultureInfo.DefaultThreadCurrentCulture,
|
||||
CultureInfo.DefaultThreadCurrentUICulture
|
||||
}.Any(c =>
|
||||
c is not null && (
|
||||
c.Name.Contains("-ru", StringComparison.OrdinalIgnoreCase) ||
|
||||
c.Name.Contains("-by", StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
);
|
||||
var isSanctioned =
|
||||
CultureInfo.CurrentCulture.Name.EndsWith("-ru", StringComparison.OrdinalIgnoreCase) ||
|
||||
CultureInfo.CurrentCulture.Name.EndsWith("-by", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (!isSanctioned)
|
||||
return;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
|
||||
|
@ -20,19 +19,9 @@ public static class Sanctions
|
|||
if (isSkipped)
|
||||
return;
|
||||
|
||||
var isSanctioned = new[]
|
||||
{
|
||||
CultureInfo.CurrentCulture,
|
||||
CultureInfo.CurrentUICulture,
|
||||
CultureInfo.InstalledUICulture,
|
||||
CultureInfo.DefaultThreadCurrentCulture,
|
||||
CultureInfo.DefaultThreadCurrentUICulture
|
||||
}.Any(c =>
|
||||
c is not null && (
|
||||
c.Name.Contains("-ru", StringComparison.OrdinalIgnoreCase) ||
|
||||
c.Name.Contains("-by", StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
);
|
||||
var isSanctioned =
|
||||
CultureInfo.CurrentCulture.Name.EndsWith("-ru", StringComparison.OrdinalIgnoreCase) ||
|
||||
CultureInfo.CurrentCulture.Name.EndsWith("-by", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (!isSanctioned)
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue