Skip to content

Commit

Permalink
ёёёё
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgencheg committed Sep 7, 2024
1 parent 91cd78d commit 2ba9118
Show file tree
Hide file tree
Showing 20 changed files with 159 additions and 576 deletions.
2 changes: 1 addition & 1 deletion Content.Client/Research/UI/ResearchConsoleMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
Title="{Loc 'research-console-menu-title'}"
MinSize="625 400"
SetSize="700 550">
SetSize="760 550"> <!-- Corvax-Localization -->
<BoxContainer Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True">
Expand Down
36 changes: 32 additions & 4 deletions Content.Server/Speech/EntitySystems/FrontalLispSystem.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
using Robust.Shared.Random; // Corvax-Localization

namespace Content.Server.Speech.EntitySystems;

public sealed class FrontalLispSystem : EntitySystem
{
// @formatter:off
private static readonly Regex RegexUpperTh = new(@"[T]+[Ss]+|[S]+[Cc]+(?=[IiEeYy]+)|[C]+(?=[IiEeYy]+)|[P][Ss]+|([S]+[Tt]+|[T]+)(?=[Ii]+[Oo]+[Uu]*[Nn]*)|[C]+[Hh]+(?=[Ii]*[Ee]*)|[Z]+|[S]+|[X]+(?=[Ee]+)");
private static readonly Regex RegexLowerTh = new(@"[t]+[s]+|[s]+[c]+(?=[iey]+)|[c]+(?=[iey]+)|[p][s]+|([s]+[t]+|[t]+)(?=[i]+[o]+[u]*[n]*)|[c]+[h]+(?=[i]*[e]*)|[z]+|[s]+|[x]+(?=[e]+)");
private static readonly Regex RegexUpperEcks = new(@"[E]+[Xx]+[Cc]*|[X]+");
private static readonly Regex RegexLowerEcks = new(@"[e]+[x]+[c]*|[x]+");
// @formatter:on

[Dependency] private readonly IRobustRandom _random = default!; // Corvax-Localization

public override void Initialize()
{
base.Initialize();
Expand All @@ -16,11 +26,29 @@ private void OnAccent(EntityUid uid, FrontalLispComponent component, AccentGetEv
var message = args.Message;

// handles ts, sc(i|e|y), c(i|e|y), ps, st(io(u|n)), ch(i|e), z, s
message = Regex.Replace(message, @"[T]+[Ss]+|[S]+[Cc]+(?=[IiEeYy]+)|[C]+(?=[IiEeYy]+)|[P][Ss]+|([S]+[Tt]+|[T]+)(?=[Ii]+[Oo]+[Uu]*[Nn]*)|[C]+[Hh]+(?=[Ii]*[Ee]*)|[Z]+|[S]+|[X]+(?=[Ee]+)", "TH");
message = Regex.Replace(message, @"[t]+[s]+|[s]+[c]+(?=[iey]+)|[c]+(?=[iey]+)|[p][s]+|([s]+[t]+|[t]+)(?=[i]+[o]+[u]*[n]*)|[c]+[h]+(?=[i]*[e]*)|[z]+|[s]+|[x]+(?=[e]+)", "th");
message = RegexUpperTh.Replace(message, "TH");
message = RegexLowerTh.Replace(message, "th");
// handles ex(c), x
message = Regex.Replace(message, @"[E]+[Xx]+[Cc]*|[X]+", "EKTH");
message = Regex.Replace(message, @"[e]+[x]+[c]*|[x]+", "ekth");
message = RegexUpperEcks.Replace(message, "EKTH");
message = RegexLowerEcks.Replace(message, "ekth");

// Corvax-Localization Start
// с - ш
message = Regex.Replace(message, @"с", _random.Prob(0.90f) ? "ш" : "с");
message = Regex.Replace(message, @"С", _random.Prob(0.90f) ? "Ш" : "С");
// ч - ш
message = Regex.Replace(message, @"ч", _random.Prob(0.90f) ? "ш" : "ч");
message = Regex.Replace(message, @"Ч", _random.Prob(0.90f) ? "Ш" : "Ч");
// ц - ч
message = Regex.Replace(message, @"ц", _random.Prob(0.90f) ? "ч" : "ц");
message = Regex.Replace(message, @"Ц", _random.Prob(0.90f) ? "Ч" : "Ц");
// т - ч
message = Regex.Replace(message, @"\B[т](?![АЕЁИОУЫЭЮЯаеёиоуыэюя])", _random.Prob(0.90f) ? "ч" : "т");
message = Regex.Replace(message, @"\B[Т](?![АЕЁИОУЫЭЮЯаеёиоуыэюя])", _random.Prob(0.90f) ? "Ч" : "Т");
// з - ж
message = Regex.Replace(message, @"з", _random.Prob(0.90f) ? "ж" : "з");
message = Regex.Replace(message, @"З", _random.Prob(0.90f) ? "Ж" : "З");
// Corvax-Localization End

args.Message = message;
}
Expand Down
69 changes: 64 additions & 5 deletions Content.Server/Speech/EntitySystems/LizardAccentSystem.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
using Robust.Shared.Random;

namespace Content.Server.Speech.EntitySystems;

public sealed class LizardAccentSystem : EntitySystem
{
private static readonly Regex RegexLowerS = new("s+");
private static readonly Regex RegexUpperS = new("S+");
private static readonly Regex RegexInternalX = new(@"(\w)x");
private static readonly Regex RegexLowerEndX = new(@"\bx([\-|r|R]|\b)");
private static readonly Regex RegexUpperEndX = new(@"\bX([\-|r|R]|\b)");

[Dependency] private readonly IRobustRandom _random = default!; // Corvax-Localization

public override void Initialize()
{
base.Initialize();
Expand All @@ -16,16 +25,66 @@ private void OnAccent(EntityUid uid, LizardAccentComponent component, AccentGetE
var message = args.Message;

// hissss
message = Regex.Replace(message, "s+", "sss");
message = RegexLowerS.Replace(message, "sss");
// hiSSS
message = Regex.Replace(message, "S+", "SSS");
message = RegexUpperS.Replace(message, "SSS");
// ekssit
message = Regex.Replace(message, @"(\w)x", "$1kss");
message = RegexInternalX.Replace(message, "$1kss");
// ecks
message = Regex.Replace(message, @"\bx([\-|r|R]|\b)", "ecks$1");
message = RegexLowerEndX.Replace(message, "ecks$1");
// eckS
message = Regex.Replace(message, @"\bX([\-|r|R]|\b)", "ECKS$1");
message = RegexUpperEndX.Replace(message, "ECKS$1");

// Corvax-Localization-Start
// c => ссс
message = Regex.Replace(
message,
"с+",
_random.Pick(new List<string>() { "сс", "ссс" })
);
// С => CCC
message = Regex.Replace(
message,
"С+",
_random.Pick(new List<string>() { "СС", "ССС" })
);
// з => ссс
message = Regex.Replace(
message,
"з+",
_random.Pick(new List<string>() { "сс", "ссс" })
);
// З => CCC
message = Regex.Replace(
message,
"З+",
_random.Pick(new List<string>() { "СС", "ССС" })
);
// ш => шшш
message = Regex.Replace(
message,
"ш+",
_random.Pick(new List<string>() { "шш", "шшш" })
);
// Ш => ШШШ
message = Regex.Replace(
message,
"Ш+",
_random.Pick(new List<string>() { "ШШ", "ШШШ" })
);
// ч => щщщ
message = Regex.Replace(
message,
"ч+",
_random.Pick(new List<string>() { "щщ", "щщщ" })
);
// Ч => ЩЩЩ
message = Regex.Replace(
message,
"Ч+",
_random.Pick(new List<string>() { "ЩЩ", "ЩЩЩ" })
);
// Corvax-Localization-End
args.Message = message;
}
}
39 changes: 36 additions & 3 deletions Content.Server/Speech/EntitySystems/MothAccentSystem.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
using Robust.Shared.Random;

namespace Content.Server.Speech.EntitySystems;

public sealed class MothAccentSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!; // Corvax-Localization

private static readonly Regex RegexLowerBuzz = new Regex("z{1,3}");
private static readonly Regex RegexUpperBuzz = new Regex("Z{1,3}");

public override void Initialize()
{
base.Initialize();
Expand All @@ -16,10 +22,37 @@ private void OnAccent(EntityUid uid, MothAccentComponent component, AccentGetEve
var message = args.Message;

// buzzz
message = Regex.Replace(message, "z{1,3}", "zzz");
message = RegexLowerBuzz.Replace(message, "zzz");
// buZZZ
message = Regex.Replace(message, "Z{1,3}", "ZZZ");

message = RegexUpperBuzz.Replace(message, "ZZZ");

// Corvax-Localization-Start
// ж => жжж
message = Regex.Replace(
message,
"ж+",
_random.Pick(new List<string>() { "жж", "жжж" })
);
// Ж => ЖЖЖ
message = Regex.Replace(
message,
"Ж+",
_random.Pick(new List<string>() { "ЖЖ", "ЖЖЖ" })
);
// з => ссс
message = Regex.Replace(
message,
"з+",
_random.Pick(new List<string>() { "зз", "ззз" })
);
// З => CCC
message = Regex.Replace(
message,
"З+",
_random.Pick(new List<string>() { "ЗЗ", "ЗЗЗ" })
);
// Corvax-Localization-End

args.Message = message;
}
}
5 changes: 5 additions & 0 deletions Content.Server/Speech/EntitySystems/OwOAccentSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public sealed class OwOAccentSystem : EntitySystem
private static readonly IReadOnlyDictionary<string, string> SpecialWords = new Dictionary<string, string>()
{
{ "you", "wu" },
{ "ты", "ти" }, // Corvax-Localization
};

public override void Initialize()
Expand All @@ -29,6 +30,10 @@ public string Accentuate(string message)
}

return message.Replace("!", _random.Pick(Faces))
// Corvax-Localization-Start
.Replace("р", "в").Replace("Р", "В")
.Replace("л", "в").Replace("Л", "В")
// Corvax-Localization-End
.Replace("r", "w").Replace("R", "W")
.Replace("l", "w").Replace("L", "W");
}
Expand Down
6 changes: 6 additions & 0 deletions Content.Server/Speech/EntitySystems/SlurredSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ private string Accentuate(string message, float scale)
'a' => "ah",
'u' => "oo",
'c' => "k",
// Corvax-Localization Start
'о' => "а",
'к' => "кх",
'щ' => "шч",
'ц' => "тс",
// Corvax-Localization End
_ => $"{character}",
};

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Speech/EntitySystems/StutteringSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public sealed class StutteringSystem : SharedStutteringSystem
[Dependency] private readonly IRobustRandom _random = default!;

// Regex of characters to stutter.
private static readonly Regex Stutter = new(@"[b-df-hj-np-tv-wxyz]",
private static readonly Regex Stutter = new(@"[b-df-hj-np-tv-wxyz-б-вд-к-лмн-прст]", // Corvax-Localization
RegexOptions.Compiled | RegexOptions.IgnoreCase);

public override void Initialize()
Expand Down
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/_LostParadise/command_locs.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ command-description-types-fullname = .
command-description-AddCommand = .
command-description-AddVecCommand = .
command-description-SubtractCommand = .
command-description-SubVecCommand= .
command-description-SubVecCommand = .
command-description-MultiplyCommand = .
command-description-MulVecCommand = .
command-description-DivideCommand = .
Expand Down
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/cluwne/cluwne.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cluwne-transform = { CAPITALIZE($target) } превратился в клувеня!
cluwne-name-prefix = клувень {$target}
cluwne-name-prefix = клувень { $target }
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/deltav/guidebook/guides.ftl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
guide-entry-justice = Отдел Юстиции
guide-entry-justice = Отдел Юстиции
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/glue/glue.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
glue-success = Вы покрыли { $target } клеем!
glued-name-prefix = липкий {$target}
glued-name-prefix = липкий { $target }
glue-failure = Не удалось покрыть { $target } клеем.
glue-verb-text = Нанести клей
glue-verb-message = Покрыть предмет клеем
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/lube/lube.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lube-success = Вы покрыли { $target } смазкой!
lubed-name-prefix = смазанный {$target}
lubed-name-prefix = смазанный { $target }
lube-failure = Не удалось покрыть { $target } смазкой!
lube-slip = { $target } выскальзывает из ваших рук!
lube-verb-text = Нанести смазку
Expand Down
9 changes: 9 additions & 0 deletions Resources/Prototypes/Voice/disease_emotes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
chatMessages: [ coughs ]
chatTriggers:
- coughs
# Corvax-Localization-Start
- кашель
- кашляет
- кашлянул
# Corvax-Localization-End

- type: emote
id: CatMeow
Expand Down Expand Up @@ -36,6 +41,10 @@
chatMessages: [ yawns ]
chatTriggers:
- yawns
# Corvax-Localization-Start
- зевок
- зевает
# Corvax-Localization-End

- type: emote
id: Snore
Expand Down

This file was deleted.

Loading

0 comments on commit 2ba9118

Please sign in to comment.