Rename Fluent-related code to be more precise.

This commit is contained in:
Paul Chote
2024-10-01 19:34:12 +01:00
committed by Gustas
parent 771b9ddfda
commit b29b685058
176 changed files with 1349 additions and 1369 deletions

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Commands
public class ChatCommands : INotifyChat
{
[TranslationReference("name")]
[FluentReference("name")]
const string InvalidCommand = "notification-invalid-command";
public Dictionary<string, IChatCommand> Commands { get; }
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Commands
if (Commands.TryGetValue(name, out var command))
command.InvokeCommand(name, message[(1 + name.Length)..].Trim());
else
TextNotificationsManager.Debug(TranslationProvider.GetString(InvalidCommand, Translation.Arguments("name", name)));
TextNotificationsManager.Debug(FluentProvider.GetString(InvalidCommand, FluentBundle.Arguments("name", name)));
return false;
}

View File

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

View File

@@ -24,55 +24,55 @@ namespace OpenRA.Mods.Common.Commands
public class DevCommands : IChatCommand, IWorldLoaded
{
[TranslationReference]
[FluentReference]
const string CheatsDisabled = "notification-cheats-disabled";
[TranslationReference]
[FluentReference]
const string InvalidCashAmount = "notification-invalid-cash-amount";
[TranslationReference]
[FluentReference]
const string ToggleVisiblityDescription = "description-toggle-visibility";
[TranslationReference]
[FluentReference]
const string GiveCashDescription = "description-give-cash";
[TranslationReference]
[FluentReference]
const string GiveCashAllDescription = "description-give-cash-all";
[TranslationReference]
[FluentReference]
const string InstantBuildingDescription = "description-instant-building";
[TranslationReference]
[FluentReference]
const string BuildAnywhereDescription = "description-build-anywhere";
[TranslationReference]
[FluentReference]
const string UnlimitedPowerDescription = "description-unlimited-power";
[TranslationReference]
[FluentReference]
const string EnableTechDescription = "description-enable-tech";
[TranslationReference]
[FluentReference]
const string FastChargeDescription = "description-fast-charge";
[TranslationReference]
[FluentReference]
const string DevCheatAllDescription = "description-dev-cheat-all";
[TranslationReference]
[FluentReference]
const string DevCrashDescription = "description-dev-crash";
[TranslationReference]
[FluentReference]
const string LevelUpActorDescription = "description-levelup-actor";
[TranslationReference]
[FluentReference]
const string PlayerExperienceDescription = "description-player-experience";
[TranslationReference]
[FluentReference]
const string PowerOutageDescription = "description-power-outage";
[TranslationReference]
[FluentReference]
const string KillSelectedActorsDescription = "description-kill-selected-actors";
[TranslationReference]
[FluentReference]
const string DisposeSelectedActorsDescription = "description-dispose-selected-actors";
readonly IDictionary<string, (string Description, Action<string, World> Handler)> commandHandlers = new Dictionary<string, (string, Action<string, World>)>
@@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Commands
if (!developerMode.Enabled)
{
TextNotificationsManager.Debug(TranslationProvider.GetString(CheatsDisabled));
TextNotificationsManager.Debug(FluentProvider.GetString(CheatsDisabled));
return;
}
@@ -149,7 +149,7 @@ namespace OpenRA.Mods.Common.Commands
giveCashOrder.ExtraData = (uint)cash;
else
{
TextNotificationsManager.Debug(TranslationProvider.GetString(InvalidCashAmount));
TextNotificationsManager.Debug(FluentProvider.GetString(InvalidCashAmount));
return;
}

View File

@@ -22,13 +22,13 @@ namespace OpenRA.Mods.Common.Commands
public class HelpCommand : IChatCommand, IWorldLoaded
{
[TranslationReference]
[FluentReference]
const string AvailableCommands = "notification-available-commands";
[TranslationReference]
[FluentReference]
const string NoDescription = "description-no-description";
[TranslationReference]
[FluentReference]
const string HelpDescription = "description-help-description";
readonly Dictionary<string, string> helpDescriptions;
@@ -52,12 +52,12 @@ namespace OpenRA.Mods.Common.Commands
public void InvokeCommand(string name, string arg)
{
TextNotificationsManager.Debug(TranslationProvider.GetString(AvailableCommands));
TextNotificationsManager.Debug(FluentProvider.GetString(AvailableCommands));
foreach (var key in console.Commands.Keys.OrderBy(k => k))
{
if (!helpDescriptions.TryGetValue(key, out var description))
description = TranslationProvider.GetString(NoDescription);
description = FluentProvider.GetString(NoDescription);
TextNotificationsManager.Debug($"{key}: {description}");
}
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Commands
public void RegisterHelp(string name, string description)
{
helpDescriptions[name] = TranslationProvider.GetString(description);
helpDescriptions[name] = FluentProvider.GetString(description);
}
}
}

View File

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