diff --git a/Content.Server/Connection/ConnectionManager.cs b/Content.Server/Connection/ConnectionManager.cs index 8319dbfffc..c78433bf55 100644 --- a/Content.Server/Connection/ConnectionManager.cs +++ b/Content.Server/Connection/ConnectionManager.cs @@ -42,16 +42,14 @@ namespace Content.Server.Connection var ban = await _db.GetServerBanByIpAsync(eventArgs.Connection.RemoteEndPoint.Address); if (ban != null) { - var expires = "This is a permanent ban."; + var expires = Loc.GetString("ban-banned-permanent"); if (ban.ExpirationTime is { } expireTime) { var duration = expireTime - ban.BanTime; var utc = expireTime.ToUniversalTime(); - expires = $"This ban is for {duration.TotalMinutes} minutes and will expire at {utc:f} UTC."; + expires = Loc.GetString("ban-expires", ("duration", duration.TotalMinutes.ToString("N0")), ("time", utc.ToString("f"))); } - var reason = $@"You, or another user of this computer or connection is banned from playing here. -The ban reason is: ""{ban.Reason}"" -{expires}"; + var reason = Loc.GetString("ban-banned-1") + "\n" + Loc.GetString("ban-banned-2", ("reason", this.Reason)) + "\n" + expires;; return NetApproval.Deny(reason); } diff --git a/Content.Server/Database/ServerBanDef.cs b/Content.Server/Database/ServerBanDef.cs index 0167f1a570..755365ca45 100644 --- a/Content.Server/Database/ServerBanDef.cs +++ b/Content.Server/Database/ServerBanDef.cs @@ -55,14 +55,15 @@ namespace Content.Server.Database public string DisconnectMessage { get { - var expires = "This is a permanent ban."; + var expires = Loc.GetString("ban-banned-permanent"); if (this.ExpirationTime is { } expireTime) { var duration = expireTime - this.BanTime; var utc = expireTime.ToUniversalTime(); - expires = $"This ban is for {duration.TotalMinutes:N0} minutes and will expire at {utc:f} UTC."; + expires = Loc.GetString("ban-expires", ("duration", duration.TotalMinutes.ToString("N0")), ("time", utc.ToString("f"))); } - return $"You, or another user of this computer or connection, are banned from playing here.\nThe ban reason is: \"{this.Reason}\"\n{expires}"; + var details = Loc.GetString("ban-banned-1") + "\n" + Loc.GetString("ban-banned-2", ("reason", this.Reason)) + "\n" + expires; + return details; } } } diff --git a/Resources/Locale/en-US/connection-messages.ftl b/Resources/Locale/en-US/connection-messages.ftl index 752dacac66..0c8740b6c9 100644 --- a/Resources/Locale/en-US/connection-messages.ftl +++ b/Resources/Locale/en-US/connection-messages.ftl @@ -16,5 +16,10 @@ command-whitelistremove-not-found = Unable to find '{$username}' command-kicknonwhitelisted-description = Kicks all non-whitelisted players from the server. command-kicknonwhitelisted-help = kicknonwhitelisted +ban-banned-permanent = This ban is appeal only. +ban-expires = This ban is for {$duration} minutes and will expire at {$time} UTC. +ban-banned-1 = You, or another user of this computer or connection, are banned from playing here. +ban-banned-2 = The ban reason is: "{$reason}" + soft-player-cap-full = The server is full! panic-bunker-account-denied = This server is in Panic mode and you were rejected. Contact the server administrator for help.