Skip to content

Commit

Permalink
chore: server core localized strings (AscensionGameDev#2338)
Browse files Browse the repository at this point in the history
* server localization chore: AccountNamespace and General

- Alphabetically sorted the properties.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Changed the property name none to None to follow PascalCase naming convention.
- Improved the string messages grammar where necessary.
- Adds new messages for notice and error notice.
- Removed unused messages
- Fixed issue with swapped messages order within the ErrorMessagePacket handler

* server localization chore: BagsNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: BankNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: ChatNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: ClassNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: ColorNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: CombatNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.
- Removed unused messages.

* server localization chore: CommandOutputNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.
- Removed unused messages.

* server localization chore: CraftingNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: DatabaseNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: ErrorsNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: EventsNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.
- Deleted unused messages (also a few outside the scope of EventsNamespace).

* server localization chore: FormulasNamespace

- Removed unused messages.
- Improved strings grammar where necessary.

* server localization chore: FriendsNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: GeneralNamespace (again)

- Removes unused messages.

* server localization chore: GuildsNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: IntroNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: ItemsNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.
- Solves a TODO leftover.
- Removes unused messages.

* server localization chore: MappingNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: MigrationNamespace

- Alphabetically sorted properties.
- Improved grammar where necessary.
- Removed unused messages

* server localization chore: NetDebugNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Improved strings grammar where necessary.

* server localization chore: NetworkingNamespace

- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.
- Removed unused messages.

* server localization chore: NotificationsNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Improved strings grammar where necessary.

* server localization chore: PartiesNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: PasswordResetNotificationNamespace

- Renamed property to follow PascalCase naming convention.

* server localization chore: PlayerNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.
- Removed unused properties.

* server localization chore: PortcheckingNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.
- Removed unused properties.

* server localization chore: QuestsNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Improved strings grammar where necessary.

* server localization chore: RegexNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Removed unused properties.

* server localization chore: ShopsNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: TradingNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.

* server localization chore: UpnpNamespace

- Alphabetically sorted the properties and Renamed them to follow PascalCase naming convention.
- Added [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] to all properties.
- Improved strings grammar where necessary.
  • Loading branch information
Arufonsu authored Jul 22, 2024
1 parent daa2827 commit e9de494
Show file tree
Hide file tree
Showing 45 changed files with 890 additions and 1,120 deletions.
2 changes: 1 addition & 1 deletion Intersect.Client/Networking/PacketHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ public void HandlePacket(IPacketSender packetSender, ErrorMessagePacket packet)
{
Fade.FadeIn(ClientConfiguration.Instance.FadeDurationMs);
Globals.WaitingOnServer = false;
Interface.Interface.ShowError(packet.Header, packet.Error);
Interface.Interface.ShowError(packet.Error, packet.Header);
Interface.Interface.MenuUi?.Reset();
}

Expand Down
16 changes: 8 additions & 8 deletions Intersect.Server.Core/Core/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ public static void Start(params string[] args)
{
if (noHaltOnError)
{
Console.WriteLine(Strings.Errors.errorservercrashnohalt);
Console.WriteLine(Strings.Errors.ErrorServerCrashNoHalt);
}
else
{
Console.WriteLine(Strings.Errors.errorservercrash);
Console.WriteLine(Strings.Errors.ErrorServerCrash);
Console.ReadLine();
}
}
Expand Down Expand Up @@ -181,7 +181,7 @@ private static bool PreContextSetup(params string[] args)

if (!Options.LoadFromDisk())
{
Console.WriteLine(Strings.Errors.errorloadingconfig);
Console.WriteLine(Strings.Errors.ErrorLoadingConfiguration);
Console.ReadKey();

return false;
Expand Down Expand Up @@ -281,7 +281,7 @@ private static bool PostContextSetup()
Console.WriteLine(Strings.Commandoutput.EventCount.ToString(EventBase.Lookup.Count));
Console.WriteLine(Strings.Commandoutput.ItemCount.ToString(ItemBase.Lookup.Count));
Console.WriteLine();
Console.WriteLine(Strings.Commandoutput.gametime.ToString(Time.GetTime().ToString("F")));
Console.WriteLine(Strings.Commandoutput.GameTime.ToString(Time.GetTime().ToString("F")));
Console.WriteLine();

PacketSender.CacheGameDataPacket();
Expand All @@ -304,12 +304,12 @@ private static void PrintIntroduction()
Console.WriteLine(@" | | | '_ \| __/ _ \ '__/ __|/ _ \/ __| __|");
Console.WriteLine(@" _| |_| | | | || __/ | \__ \ __/ (__| |_ ");
Console.WriteLine(@" |_____|_| |_|\__\___|_| |___/\___|\___|\__|");
Console.WriteLine(Strings.Intro.tagline);
Console.WriteLine(Strings.Intro.Tagline);
Console.WriteLine(@"Copyright (C) 2020 Ascension Game Dev");
Console.WriteLine(Strings.Intro.version.ToString(Assembly.GetExecutingAssembly().GetName().Version));
Console.WriteLine(Strings.Intro.support);
Console.WriteLine(Strings.Intro.Version.ToString(Assembly.GetExecutingAssembly().GetName().Version));
Console.WriteLine(Strings.Intro.Support);
Console.WriteLine();
Console.WriteLine(Strings.Intro.loading);
Console.WriteLine(Strings.Intro.Loading);
}

#endregion
Expand Down
4 changes: 2 additions & 2 deletions Intersect.Server.Core/Core/ServerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ protected virtual void InternalStartNetworking()
}
else
{
Console.WriteLine(Strings.Intro.started.ToString(Options.ServerPort));
Console.WriteLine(Strings.Intro.ServerStarted.ToString(Options.ServerPort));
}
}

Expand All @@ -263,7 +263,7 @@ protected virtual void InternalStartNetworking()
#region Exception Handling

protected override void NotifyNonTerminatingExceptionOccurred() =>
Console.WriteLine(Strings.Errors.errorlogged);
Console.WriteLine(Strings.Errors.ErrorLogged);

internal static void DispatchUnhandledException(Exception exception, bool isTerminating = true)
{
Expand Down
26 changes: 13 additions & 13 deletions Intersect.Server.Core/Database/DbInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,25 +358,25 @@ private static bool EnsureUpdated(IServerContext serverContext)
else
{
Console.WriteLine();
Console.WriteLine(Strings.Database.upgraderequired);
Console.WriteLine(Strings.Database.UpgradeRequired);
Console.WriteLine(
Strings.Database.upgradebackup.ToString(Strings.Database.upgradeready, Strings.Database.upgradeexit)
Strings.Database.UpgradeBackup.ToString(Strings.Database.UpgradeReady, Strings.Database.UpgradeExit)
);

Console.WriteLine();
while (true)
{
Console.Write("> ");
var input = Console.ReadLine().Trim();
if (input == Strings.Database.upgradeready.ToString().Trim())
if (input == Strings.Database.UpgradeReady.ToString().Trim())
{
break;
}

if (
!string.Equals(
input,
Strings.Database.upgradeexit.ToString().Trim(),
Strings.Database.UpgradeExit.ToString().Trim(),
StringComparison.CurrentCultureIgnoreCase
)
)
Expand Down Expand Up @@ -463,7 +463,7 @@ public static void SetPlayerPower(string username, UserRights power)
}
else
{
Console.WriteLine(Strings.Account.doesnotexist);
Console.WriteLine(Strings.Account.AccountDoesNotExist);
}
}

Expand All @@ -478,7 +478,7 @@ public static bool SetPlayerPower(User user, UserRights power)
}
else
{
Console.WriteLine(Strings.Account.doesnotexist);
Console.WriteLine(Strings.Account.AccountDoesNotExist);

return false;
}
Expand Down Expand Up @@ -1421,7 +1421,7 @@ private static void OnMapsLoaded()
{
if (MapBase.Lookup.Count == 0)
{
Console.WriteLine(Strings.Database.nomaps);
Console.WriteLine(Strings.Database.NoMaps);
AddGameObject(GameObjectType.Map);
}

Expand All @@ -1439,7 +1439,7 @@ private static void OnClassesLoaded()
{
if (ClassBase.Lookup.Count == 0)
{
Console.WriteLine(Strings.Database.noclasses);
Console.WriteLine(Strings.Database.NoClasses);
var cls = (ClassBase)AddGameObject(GameObjectType.Class);
cls.Name = Strings.Database.Default;
var defaultMale = new ClassSprite()
Expand Down Expand Up @@ -1477,8 +1477,8 @@ public static void CachePlayerVariableEventTextLookups()
{
if (!string.IsNullOrWhiteSpace(variable.TextId) && !addedIds.Contains(variable.TextId))
{
lookup.Add(Strings.Events.playervar + "{" + variable.TextId + "}", variable);
lookup.Add(Strings.Events.playerswitch + "{" + variable.TextId + "}", variable);
lookup.Add(Strings.Events.PlayerVariable + "{" + variable.TextId + "}", variable);
lookup.Add(Strings.Events.PlayerSwitch + "{" + variable.TextId + "}", variable);
addedIds.Add(variable.TextId);
}
}
Expand All @@ -1493,8 +1493,8 @@ public static void CacheServerVariableEventTextLookups()
{
if (!string.IsNullOrWhiteSpace(variable.TextId) && !addedIds.Contains(variable.TextId))
{
lookup.Add(Strings.Events.globalvar + "{" + variable.TextId + "}", variable);
lookup.Add(Strings.Events.globalswitch + "{" + variable.TextId + "}", variable);
lookup.Add(Strings.Events.GlobalVariable + "{" + variable.TextId + "}", variable);
lookup.Add(Strings.Events.GlobalSwitch + "{" + variable.TextId + "}", variable);
addedIds.Add(variable.TextId);
}
}
Expand All @@ -1509,7 +1509,7 @@ public static void CacheGuildVariableEventTextLookups()
{
if (!string.IsNullOrWhiteSpace(variable.TextId) && !addedIds.Contains(variable.TextId))
{
lookup.Add(Strings.Events.guildvar + "{" + variable.TextId + "}", variable);
lookup.Add(Strings.Events.GuildVariable + "{" + variable.TextId + "}", variable);
addedIds.Add(variable.TextId);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Intersect.Server.Core/Database/PlayerData/Ban.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public static string CheckBan(User user, string ip)

return expired
? null
: Strings.Account.banstatus.ToString(ban.StartTime, ban.Banner, ban.EndTime, ban.Reason);
: Strings.Account.BanStatus.ToString(ban.StartTime, ban.Banner, ban.EndTime, ban.Reason);
}

public static bool IsBanned(IPAddress ipAddress, [NotNullWhen(true)] out string? message)
Expand Down
4 changes: 2 additions & 2 deletions Intersect.Server.Core/Database/PlayerData/Mute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ string ip

return expired
? null
: Strings.Account.mutestatus.ToString(mute.StartTime, mute.Muter, mute.EndTime, mute.Reason);
: Strings.Account.MuteStatus.ToString(mute.StartTime, mute.Muter, mute.EndTime, mute.Reason);
}
catch (Exception ex)
{
Expand Down Expand Up @@ -270,7 +270,7 @@ string ip

return expired
? null
: Strings.Account.mutestatus.ToString(mute.StartTime, mute.Muter, mute.EndTime, mute.Reason);
: Strings.Account.MuteStatus.ToString(mute.StartTime, mute.Muter, mute.EndTime, mute.Reason);
}
catch (Exception ex)
{
Expand Down
4 changes: 2 additions & 2 deletions Intersect.Server.Core/Database/PlayerData/Players/Guild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static Guild CreateGuild(Player creator, string name)
{
name = name.Trim();

if (creator != null && FieldChecking.IsValidGuildName(name, Strings.Regex.guildname))
if (creator != null && FieldChecking.IsValidGuildName(name, Strings.Regex.GuildName))
{
using (var context = DbInterface.CreatePlayerContext(readOnly: false))
{
Expand Down Expand Up @@ -708,7 +708,7 @@ public void ExpandBankSlots(int count)
/// <param name="initiator">The player who initiated this change (null if done by the api or some other method).</param>
public bool Rename(string name, Player initiator = null)
{
if (GuildExists(name) || !FieldChecking.IsValidGuildName(name, Strings.Regex.guildname))
if (GuildExists(name) || !FieldChecking.IsValidGuildName(name, Strings.Regex.GuildName))
{
return false;
}
Expand Down
14 changes: 7 additions & 7 deletions Intersect.Server.Core/Database/PlayerData/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -870,19 +870,19 @@ public static bool TryRegister(

if (Options.BlockClientRegistrations)
{
error = Strings.Account.registrationsblocked;
error = Strings.Account.RegistrationsBlocked;
return false;
}

if (!FieldChecking.IsValidUsername(username, Strings.Regex.username))
if (!FieldChecking.IsValidUsername(username, Strings.Regex.Username))
{
error = Strings.Account.invalidname;
error = Strings.Account.InvalidName;
return false;
}

if (!FieldChecking.IsWellformedEmailAddress(email, Strings.Regex.email))
if (!FieldChecking.IsWellformedEmailAddress(email, Strings.Regex.Email))
{
error = Strings.Account.invalidemail;
error = Strings.Account.InvalidEmail;
return false;
}

Expand All @@ -894,13 +894,13 @@ public static bool TryRegister(

if (UserExists(username))
{
error = Strings.Account.exists;
error = Strings.Account.AccountAlreadyExists;
return false;
}

if (UserExists(email))
{
error = Strings.Account.emailexists;
error = Strings.Account.EmailExists;
return false;
}

Expand Down
14 changes: 7 additions & 7 deletions Intersect.Server.Core/Entities/BankInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public bool TryDepositItem(Item? slot, int inventorySlotIndex, int quantityHint,
{
PacketSender.SendChatMsg(
mPlayer,
Strings.Banks.depositinvalid,
Strings.Banks.DepositInvalid,
ChatMessageType.Bank,
CustomColors.Alerts.Error
);
Expand All @@ -114,7 +114,7 @@ public bool TryDepositItem(Item? slot, int inventorySlotIndex, int quantityHint,

if (!canBank)
{
PacketSender.SendChatMsg(mPlayer, Strings.Items.nobank, ChatMessageType.Bank, CustomColors.Items.Bound);
PacketSender.SendChatMsg(mPlayer, Strings.Items.NoBank, ChatMessageType.Bank, CustomColors.Items.Bound);
return false;
}

Expand All @@ -139,7 +139,7 @@ public bool TryDepositItem(Item? slot, int inventorySlotIndex, int quantityHint,
{
PacketSender.SendChatMsg(
mPlayer,
Strings.Banks.banknospace,
Strings.Items.NoSpaceForItem,
ChatMessageType.Bank,
CustomColors.Alerts.Error
);
Expand All @@ -165,7 +165,7 @@ out var slotIndicesToRemoveFrom
{
PacketSender.SendChatMsg(
mPlayer,
Strings.Banks.withdrawinvalid,
Strings.Banks.WithdrawInvalid,
ChatMessageType.Bank,
CustomColors.Alerts.Error
);
Expand Down Expand Up @@ -322,7 +322,7 @@ public bool TryWithdrawItem(Item? slot, int bankSlotIndex, int quantityHint, int
{
PacketSender.SendChatMsg(
mPlayer,
Strings.Banks.withdrawinvalid,
Strings.Banks.WithdrawInvalid,
ChatMessageType.Bank,
CustomColors.Alerts.Error
);
Expand Down Expand Up @@ -350,7 +350,7 @@ public bool TryWithdrawItem(Item? slot, int bankSlotIndex, int quantityHint, int
{
PacketSender.SendChatMsg(
mPlayer,
Strings.Banks.inventorynospace,
Strings.Items.NoSpaceForItem,
ChatMessageType.Inventory,
CustomColors.Alerts.Error
);
Expand All @@ -376,7 +376,7 @@ out var slotIndicesToRemoveFrom
{
PacketSender.SendChatMsg(
mPlayer,
Strings.Banks.withdrawinvalid,
Strings.Banks.WithdrawInvalid,
ChatMessageType.Bank,
CustomColors.Alerts.Error
);
Expand Down
Loading

0 comments on commit e9de494

Please sign in to comment.