]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Аnnouncement sender localization (#29907)
authorchavonadelal <156101927+chavonadelal@users.noreply.github.com>
Thu, 11 Jul 2024 14:02:53 +0000 (17:02 +0300)
committerGitHub <noreply@github.com>
Thu, 11 Jul 2024 14:02:53 +0000 (00:02 +1000)
Content.Server/Chat/Systems/AnnounceOnSpawnSystem.cs
Content.Server/Chat/Systems/ChatSystem.cs
Resources/Locale/en-US/chat/managers/chat-manager.ftl

index 0f0365e56ba6e7df0523538bc5e351d68a06acf1..cc46545237b09caff7f8ccc5af75daf4f6372e84 100644 (file)
@@ -16,7 +16,7 @@ public sealed class AnnounceOnSpawnSystem : EntitySystem
     private void OnInit(EntityUid uid, AnnounceOnSpawnComponent comp, MapInitEvent args)
     {
         var message = Loc.GetString(comp.Message);
-        var sender = comp.Sender != null ? Loc.GetString(comp.Sender) : "Central Command";
+        var sender = comp.Sender != null ? Loc.GetString(comp.Sender) : Loc.GetString("chat-manager-sender-announcement");
         _chat.DispatchGlobalAnnouncement(message, sender, playSound: true, comp.Sound, comp.Color);
     }
 }
index 55beaf1f7f5c506f2d81a3483d3a94c6ee3c47ac..5358cdb44209f98e6ad6802351b3a21ea58ffb21 100644 (file)
@@ -319,12 +319,14 @@ public sealed partial class ChatSystem : SharedChatSystem
     /// <param name="colorOverride">Optional color for the announcement message</param>
     public void DispatchGlobalAnnouncement(
         string message,
-        string sender = "Central Command",
+        string? sender = null,
         bool playSound = true,
         SoundSpecifier? announcementSound = null,
         Color? colorOverride = null
         )
     {
+        sender ??= Loc.GetString("chat-manager-sender-announcement");
+
         var wrappedMessage = Loc.GetString("chat-manager-sender-announcement-wrap-message", ("sender", sender), ("message", FormattedMessage.EscapeText(message)));
         _chatManager.ChatMessageToAll(ChatChannel.Radio, message, wrappedMessage, default, false, true, colorOverride);
         if (playSound)
@@ -345,11 +347,13 @@ public sealed partial class ChatSystem : SharedChatSystem
     public void DispatchStationAnnouncement(
         EntityUid source,
         string message,
-        string sender = "Central Command",
+        string? sender = null,
         bool playDefaultSound = true,
         SoundSpecifier? announcementSound = null,
         Color? colorOverride = null)
     {
+        sender ??= Loc.GetString("chat-manager-sender-announcement");
+
         var wrappedMessage = Loc.GetString("chat-manager-sender-announcement-wrap-message", ("sender", sender), ("message", FormattedMessage.EscapeText(message)));
         var station = _stationSystem.GetOwningStation(source);
 
index 38b12251bec6acecbb971c5aadb8324028af3275..75ff4351c1d2e3d88c7372b0e32e96f5cb57d4fe 100644 (file)
@@ -19,6 +19,7 @@ chat-manager-no-such-channel = There is no channel with key '{$key}'!
 chat-manager-whisper-headset-on-message = You can't whisper on the radio!
 
 chat-manager-server-wrap-message = [bold]{$message}[/bold]
+chat-manager-sender-announcement = Central Command
 chat-manager-sender-announcement-wrap-message = [font size=14][bold]{$sender} Announcement:[/font][font size=12]
                                                 {$message}[/bold][/font]
 chat-manager-entity-say-wrap-message = [BubbleHeader][bold][Name]{$entityName}[/Name][/bold][/BubbleHeader] {$verb}, [font={$fontType} size={$fontSize}]"[BubbleContent]{$message}[/BubbleContent]"[/font]