Localise text notifications.

This commit is contained in:
Matthias Mailänder
2022-10-19 12:20:25 +02:00
committed by abcdefg30
parent c041ea7d39
commit 44aaf4dd07
6 changed files with 47 additions and 8 deletions

View File

@@ -24,6 +24,9 @@ namespace OpenRA.Mods.Common.Commands
{
public Dictionary<string, IChatCommand> Commands { get; }
[TranslationReference("name")]
static readonly string InvalidCommand = "invalid-command";
public ChatCommands()
{
Commands = new Dictionary<string, IChatCommand>();
@@ -39,7 +42,7 @@ namespace OpenRA.Mods.Common.Commands
if (command.Value != null)
command.Value.InvokeCommand(name.ToLowerInvariant(), message.Substring(1 + name.Length).Trim());
else
TextNotificationsManager.Debug("{0} is not a valid command.", name);
TextNotificationsManager.Debug(Game.ModData.Translation.GetString(InvalidCommand, Translation.Arguments("name", name)));
return false;
}