mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-29 14:05:18 -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;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace DiscordChatExporter.Cli;
|
namespace DiscordChatExporter.Cli;
|
||||||
|
@ -19,19 +18,9 @@ public static class Sanctions
|
||||||
if (isSkipped)
|
if (isSkipped)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var isSanctioned = new[]
|
var isSanctioned =
|
||||||
{
|
CultureInfo.CurrentCulture.Name.EndsWith("-ru", StringComparison.OrdinalIgnoreCase) ||
|
||||||
CultureInfo.CurrentCulture,
|
CultureInfo.CurrentCulture.Name.EndsWith("-by", StringComparison.OrdinalIgnoreCase);
|
||||||
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)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!isSanctioned)
|
if (!isSanctioned)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
|
@ -20,19 +19,9 @@ public static class Sanctions
|
||||||
if (isSkipped)
|
if (isSkipped)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var isSanctioned = new[]
|
var isSanctioned =
|
||||||
{
|
CultureInfo.CurrentCulture.Name.EndsWith("-ru", StringComparison.OrdinalIgnoreCase) ||
|
||||||
CultureInfo.CurrentCulture,
|
CultureInfo.CurrentCulture.Name.EndsWith("-by", StringComparison.OrdinalIgnoreCase);
|
||||||
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)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!isSanctioned)
|
if (!isSanctioned)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue