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

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification type to play.")]
public readonly string Notification = "BaseAttack";
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display.")]
public readonly string TextNotification = null;
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
"Won't play a notification to allies if this is null.")]
public readonly string AllyNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display to allies when under attack.")]
public readonly string AllyTextNotification = null;

View File

@@ -32,10 +32,10 @@ namespace OpenRA.Mods.Common.Traits
public class ConquestVictoryConditions : ITick, INotifyWinStateChanged, INotifyTimeLimit
{
[TranslationReference("player")]
[FluentReference("player")]
const string PlayerIsVictorious = "notification-player-is-victorious";
[TranslationReference("player")]
[FluentReference("player")]
const string PlayerIsDefeated = "notification-player-is-defeated";
readonly ConquestVictoryConditionsInfo info;
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Traits
if (info.SuppressNotifications)
return;
TextNotificationsManager.AddSystemLine(PlayerIsDefeated, Translation.Arguments("player", player.ResolvedPlayerName));
TextNotificationsManager.AddSystemLine(PlayerIsDefeated, FluentBundle.Arguments("player", player.ResolvedPlayerName));
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
@@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Traits
if (info.SuppressNotifications)
return;
TextNotificationsManager.AddSystemLine(PlayerIsVictorious, Translation.Arguments("player", player.ResolvedPlayerName));
TextNotificationsManager.AddSystemLine(PlayerIsVictorious, FluentBundle.Arguments("player", player.ResolvedPlayerName));
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)

View File

@@ -20,11 +20,11 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Attach this to the player actor.")]
public class DeveloperModeInfo : TraitInfo, ILobbyOptions
{
[TranslationReference]
[FluentReference]
[Desc("Descriptive label for the developer mode checkbox in the lobby.")]
public readonly string CheckboxLabel = "checkbox-debug-menu.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the developer mode checkbox in the lobby.")]
public readonly string CheckboxDescription = "checkbox-debug-menu.description";
@@ -75,7 +75,7 @@ namespace OpenRA.Mods.Common.Traits
public class DeveloperMode : IResolveOrder, ISync, INotifyCreated, IUnlocksRenderPlayer
{
[TranslationReference("cheat", "player", "suffix")]
[FluentReference("cheat", "player", "suffix")]
const string CheatUsed = "notification-cheat-used";
readonly DeveloperModeInfo info;
@@ -275,8 +275,8 @@ namespace OpenRA.Mods.Common.Traits
return;
}
var arguments = Translation.Arguments("cheat", order.OrderString, "player", self.Owner.ResolvedPlayerName, "suffix", debugSuffix);
TextNotificationsManager.Debug(TranslationProvider.GetString(CheatUsed, arguments));
var arguments = FluentBundle.Arguments("cheat", order.OrderString, "player", self.Owner.ResolvedPlayerName, "suffix", debugSuffix);
TextNotificationsManager.Debug(FluentProvider.GetString(CheatUsed, arguments));
}
bool IUnlocksRenderPlayer.RenderPlayerUnlocked => Enabled;

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification type to play.")]
public readonly string Notification = "HarvesterAttack";
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display.")]
public readonly string TextNotification = null;

View File

@@ -22,12 +22,12 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Internal id for this checkbox.")]
public readonly string ID = null;
[TranslationReference]
[FluentReference]
[FieldLoader.Require]
[Desc("Display name for this checkbox.")]
public readonly string Label = null;
[TranslationReference]
[FluentReference]
[Desc("Description name for this checkbox.")]
public readonly string Description = null;

View File

@@ -54,19 +54,19 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string WinNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string WinTextNotification = null;
[NotificationReference("Speech")]
public readonly string LoseNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string LoseTextNotification = null;
[NotificationReference("Speech")]
public readonly string LeaveNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string LeaveTextNotification = null;
public override object Create(ActorInitializer init) { return new MissionObjectives(init.Self.Owner, this); }

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Internal id for this bot.")]
public readonly string Type = null;
[TranslationReference]
[FluentReference]
[Desc("Human-readable name this bot uses.")]
public readonly string Name = null;

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play after building placement if new construction options are available.")]
public readonly string NewOptionsNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display after building placement if new construction options are available.")]
public readonly string NewOptionsTextNotification = null;
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play if building placement is not possible.")]
public readonly string CannotPlaceNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display if building placement is not possible.")]
public readonly string CannotPlaceTextNotification = null;

View File

@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play when the player does not have any funds.")]
public readonly string InsufficientFundsNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display when the player does not have any funds.")]
public readonly string InsufficientFundsTextNotification = null;

View File

@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits
"The filename of the audio is defined per faction in notifications.yaml.")]
public readonly string ReadyAudio = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Notification displayed when production is complete.")]
public readonly string ReadyTextNotification = null;
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.Traits
"The filename of the audio is defined per faction in notifications.yaml.")]
public readonly string BlockedAudio = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Notification displayed when you can't train another actor",
"when the build limit exceeded or the exit is jammed.")]
public readonly string BlockedTextNotification = null;
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Traits
"The filename of the audio is defined per faction in notifications.yaml.")]
public readonly string LimitedAudio = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Notification displayed when you can't queue another actor",
"when the queue length limit is exceeded.")]
public readonly string LimitedTextNotification = null;
@@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits
"The filename of the audio is defined per faction in notifications.yaml.")]
public readonly string QueuedAudio = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Notification displayed when user clicks on the build palette icon.")]
public readonly string QueuedTextNotification = null;
@@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Traits
"The filename of the audio is defined per faction in notifications.yaml.")]
public readonly string OnHoldAudio = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Notification displayed when player right-clicks on the build palette icon.")]
public readonly string OnHoldTextNotification = null;
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
"The filename of the audio is defined per faction in notifications.yaml.")]
public readonly string CancelledAudio = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Notification displayed when player right-clicks on a build palette icon that is already on hold.")]
public readonly string CancelledTextNotification = null;

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Internal id for this tech level.")]
public readonly string Id;
[TranslationReference]
[FluentReference]
[Desc("Name shown in the lobby options.")]
public readonly string Name;

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech to play for the warning.")]
public readonly string Notification = "SilosNeeded";
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text to display for the warning.")]
public readonly string TextNotification = null;

View File

@@ -46,10 +46,10 @@ namespace OpenRA.Mods.Common.Traits
public class StrategicVictoryConditions : ITick, ISync, INotifyWinStateChanged, INotifyTimeLimit
{
[TranslationReference("player")]
[FluentReference("player")]
const string PlayerIsVictorious = "notification-player-is-victorious";
[TranslationReference("player")]
[FluentReference("player")]
const string PlayerIsDefeated = "notification-player-is-defeated";
readonly StrategicVictoryConditionsInfo info;
@@ -151,7 +151,7 @@ namespace OpenRA.Mods.Common.Traits
if (info.SuppressNotifications)
return;
TextNotificationsManager.AddSystemLine(PlayerIsDefeated, Translation.Arguments("player", player.ResolvedPlayerName));
TextNotificationsManager.AddSystemLine(PlayerIsDefeated, FluentBundle.Arguments("player", player.ResolvedPlayerName));
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
@@ -167,7 +167,7 @@ namespace OpenRA.Mods.Common.Traits
if (info.SuppressNotifications)
return;
TextNotificationsManager.AddSystemLine(PlayerIsVictorious, Translation.Arguments("player", player.ResolvedPlayerName));
TextNotificationsManager.AddSystemLine(PlayerIsVictorious, FluentBundle.Arguments("player", player.ResolvedPlayerName));
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)