Mark non-moddable translation strings as constant.

This commit is contained in:
Matthias Mailänder
2022-11-17 21:54:39 +01:00
committed by Gustas
parent 4f016f149f
commit 760a1245c5
58 changed files with 807 additions and 795 deletions

View File

@@ -22,10 +22,10 @@ namespace OpenRA.Mods.Common.Commands
public class ChatCommands : INotifyChat
{
public Dictionary<string, IChatCommand> Commands { get; }
[TranslationReference("name")]
static readonly string InvalidCommand = "invalid-command";
const string InvalidCommand = "invalid-command";
public Dictionary<string, IChatCommand> Commands { get; }
public ChatCommands()
{

View File

@@ -24,19 +24,19 @@ namespace OpenRA.Mods.Common.Commands
public class DebugVisualizationCommands : IChatCommand, IWorldLoaded
{
[TranslationReference]
static readonly string CombatGeometryDescription = "combat-geometry-description";
const string CombatGeometryDescription = "combat-geometry-description";
[TranslationReference]
static readonly string RenderGeometryDescription = "render-geometry-description";
const string RenderGeometryDescription = "render-geometry-description";
[TranslationReference]
static readonly string ScreenMapOverlayDescription = "screen-map-overlay-description";
const string ScreenMapOverlayDescription = "screen-map-overlay-description";
[TranslationReference]
static readonly string DepthBufferDescription = "depth-buffer-description";
const string DepthBufferDescription = "depth-buffer-description";
[TranslationReference]
static readonly string ActorTagsOverlayDescripition = "actor-tags-overlay-description";
const string ActorTagsOverlayDescripition = "actor-tags-overlay-description";
readonly IDictionary<string, (string Description, Action<DebugVisualizations, DeveloperMode> Handler)> commandHandlers = new Dictionary<string, (string Description, Action<DebugVisualizations, DeveloperMode> Handler)>
{

View File

@@ -25,55 +25,55 @@ namespace OpenRA.Mods.Common.Commands
public class DevCommands : IChatCommand, IWorldLoaded
{
[TranslationReference]
static readonly string CheatsDisabled = "cheats-disabled";
const string CheatsDisabled = "cheats-disabled";
[TranslationReference]
static readonly string InvalidCashAmount = "invalid-cash-amount";
const string InvalidCashAmount = "invalid-cash-amount";
[TranslationReference]
static readonly string ToggleVisiblityDescription = "toggle-visibility";
const string ToggleVisiblityDescription = "toggle-visibility";
[TranslationReference]
static readonly string GiveCashDescription = "give-cash";
const string GiveCashDescription = "give-cash";
[TranslationReference]
static readonly string GiveCashAllDescription = "give-cash-all";
const string GiveCashAllDescription = "give-cash-all";
[TranslationReference]
static readonly string InstantBuildingDescription = "instant-building";
const string InstantBuildingDescription = "instant-building";
[TranslationReference]
static readonly string BuildAnywhereDescription = "build-anywhere";
const string BuildAnywhereDescription = "build-anywhere";
[TranslationReference]
static readonly string UnlimitedPowerDescription = "unlimited-power";
const string UnlimitedPowerDescription = "unlimited-power";
[TranslationReference]
static readonly string EnableTechDescription = "enable-tech";
const string EnableTechDescription = "enable-tech";
[TranslationReference]
static readonly string FastChargeDescription = "fast-charge";
const string FastChargeDescription = "fast-charge";
[TranslationReference]
static readonly string DevCheatAllDescription = "dev-cheat-all";
const string DevCheatAllDescription = "dev-cheat-all";
[TranslationReference]
static readonly string DevCrashDescription = "dev-crash";
const string DevCrashDescription = "dev-crash";
[TranslationReference]
static readonly string LevelUpActorDescription = "levelup-actor";
const string LevelUpActorDescription = "levelup-actor";
[TranslationReference]
static readonly string PlayerExperienceDescription = "player-experience";
const string PlayerExperienceDescription = "player-experience";
[TranslationReference]
static readonly string PowerOutageDescription = "power-outage";
const string PowerOutageDescription = "power-outage";
[TranslationReference]
static readonly string KillSelectedActorsDescription = "kill-selected-actors";
const string KillSelectedActorsDescription = "kill-selected-actors";
[TranslationReference]
static readonly string DisposeSelectedActorsDescription = "dispose-selected-actors";
const string DisposeSelectedActorsDescription = "dispose-selected-actors";
readonly IDictionary<string, (string Description, Action<string, World> Handler)> commandHandlers = new Dictionary<string, (string, Action<string, World>)>
{

View File

@@ -21,17 +21,17 @@ namespace OpenRA.Mods.Common.Commands
public class HelpCommand : IChatCommand, IWorldLoaded
{
[TranslationReference]
const string AvailableCommands = "available-commands";
[TranslationReference]
const string NoDescription = "no-description";
[TranslationReference]
const string HelpDescription = "help-description";
readonly Dictionary<string, string> helpDescriptions;
[TranslationReference]
static readonly string AvailableCommands = "available-commands";
[TranslationReference]
static readonly string NoDescription = "no-description";
[TranslationReference]
static readonly string HelpDescription = "help-description";
World world;
ChatCommands console;

View File

@@ -20,14 +20,14 @@ namespace OpenRA.Mods.Common.Commands
public class PlayerCommands : IChatCommand, IWorldLoaded
{
[TranslationReference]
const string PauseDescription = "pause-description";
[TranslationReference]
const string SurrenderDescription = "surrender-description";
World world;
[TranslationReference]
static readonly string PauseDescription = "pause-description";
[TranslationReference]
static readonly string SurrenderDescription = "surrender-description";
public void WorldLoaded(World w, WorldRenderer wr)
{
world = w;