Refactor translation files

- Add prefixes to all message keys to provide context
- Use messages with attributes for some UI elements (dropdowns, dialogs, checkboxes, menus)
- Rename some class fields for consistency with translation keys
This commit is contained in:
Ivaylo Draganov
2022-11-10 13:46:51 +02:00
committed by Paul Chote
parent 46caa2d889
commit a0f17b15ec
89 changed files with 1095 additions and 1053 deletions

View File

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

View File

@@ -24,19 +24,19 @@ namespace OpenRA.Mods.Common.Commands
public class DebugVisualizationCommands : IChatCommand, IWorldLoaded
{
[TranslationReference]
const string CombatGeometryDescription = "combat-geometry-description";
const string CombatGeometryDescription = "description-combat-geometry";
[TranslationReference]
const string RenderGeometryDescription = "render-geometry-description";
const string RenderGeometryDescription = "description-render-geometry";
[TranslationReference]
const string ScreenMapOverlayDescription = "screen-map-overlay-description";
const string ScreenMapOverlayDescription = "description-screen-map-overlay";
[TranslationReference]
const string DepthBufferDescription = "depth-buffer-description";
const string DepthBufferDescription = "description-depth-buffer";
[TranslationReference]
const string ActorTagsOverlayDescripition = "actor-tags-overlay-description";
const string ActorTagsOverlayDescripition = "description-actor-tags-overlay";
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]
const string CheatsDisabled = "cheats-disabled";
const string CheatsDisabled = "notification-cheats-disabled";
[TranslationReference]
const string InvalidCashAmount = "invalid-cash-amount";
const string InvalidCashAmount = "notification-invalid-cash-amount";
[TranslationReference]
const string ToggleVisiblityDescription = "toggle-visibility";
const string ToggleVisiblityDescription = "description-toggle-visibility";
[TranslationReference]
const string GiveCashDescription = "give-cash";
const string GiveCashDescription = "description-give-cash";
[TranslationReference]
const string GiveCashAllDescription = "give-cash-all";
const string GiveCashAllDescription = "description-give-cash-all";
[TranslationReference]
const string InstantBuildingDescription = "instant-building";
const string InstantBuildingDescription = "description-instant-building";
[TranslationReference]
const string BuildAnywhereDescription = "build-anywhere";
const string BuildAnywhereDescription = "description-build-anywhere";
[TranslationReference]
const string UnlimitedPowerDescription = "unlimited-power";
const string UnlimitedPowerDescription = "description-unlimited-power";
[TranslationReference]
const string EnableTechDescription = "enable-tech";
const string EnableTechDescription = "description-enable-tech";
[TranslationReference]
const string FastChargeDescription = "fast-charge";
const string FastChargeDescription = "description-fast-charge";
[TranslationReference]
const string DevCheatAllDescription = "dev-cheat-all";
const string DevCheatAllDescription = "description-dev-cheat-all";
[TranslationReference]
const string DevCrashDescription = "dev-crash";
const string DevCrashDescription = "description-dev-crash";
[TranslationReference]
const string LevelUpActorDescription = "levelup-actor";
const string LevelUpActorDescription = "description-levelup-actor";
[TranslationReference]
const string PlayerExperienceDescription = "player-experience";
const string PlayerExperienceDescription = "description-player-experience";
[TranslationReference]
const string PowerOutageDescription = "power-outage";
const string PowerOutageDescription = "description-power-outage";
[TranslationReference]
const string KillSelectedActorsDescription = "kill-selected-actors";
const string KillSelectedActorsDescription = "description-kill-selected-actors";
[TranslationReference]
const string DisposeSelectedActorsDescription = "dispose-selected-actors";
const string DisposeSelectedActorsDescription = "description-dispose-selected-actors";
readonly IDictionary<string, (string Description, Action<string, World> Handler)> commandHandlers = new Dictionary<string, (string, Action<string, World>)>
{

View File

@@ -22,13 +22,13 @@ namespace OpenRA.Mods.Common.Commands
public class HelpCommand : IChatCommand, IWorldLoaded
{
[TranslationReference]
const string AvailableCommands = "available-commands";
const string AvailableCommands = "notification-available-commands";
[TranslationReference]
const string NoDescription = "no-description";
const string NoDescription = "description-no-description";
[TranslationReference]
const string HelpDescription = "help-description";
const string HelpDescription = "description-help-description";
readonly Dictionary<string, string> helpDescriptions;

View File

@@ -21,10 +21,10 @@ namespace OpenRA.Mods.Common.Commands
public class PlayerCommands : IChatCommand, IWorldLoaded
{
[TranslationReference]
const string PauseDescription = "pause-description";
const string PauseDescription = "description-pause-description";
[TranslationReference]
const string SurrenderDescription = "surrender-description";
const string SurrenderDescription = "description-surrender-description";
World world;