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

@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly int BuildPaletteOrder = 9999;
[Desc("Text shown in the production tooltip.")]
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string Description;
public static string GetInitialFaction(ActorInfo ai, string defaultFaction)

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play when selecting a primary building.")]
public readonly string SelectionNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display when selecting a primary building.")]
public readonly string SelectionTextNotification = null;

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play when a unit is delivered.")]
public readonly string ReadyAudio = "Reinforce";
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display when a unit is delivered.")]
public readonly string ReadyTextNotification = null;

View File

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

View File

@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Voice line to play when repairs are started.")]
public readonly string RepairingNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Transient text message to display when repairs are started.")]
public readonly string RepairingTextNotification = null;

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string EnabledSpeech = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string EnabledTextNotification = null;
[NotificationReference("Sounds")]
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string DisabledSpeech = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string DisabledTextNotification = null;
public override object Create(ActorInitializer init) { return new ToggleConditionOnOrder(this); }

View File

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

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits
public class EncyclopediaInfo : TraitInfo
{
[Desc("Explains the purpose in the in-game encyclopedia.")]
[TranslationReference]
[FluentReference]
public readonly string Description;
[Desc("Number for ordering the list.")]

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Sounds")]
public readonly string LevelUpNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string LevelUpTextNotification = null;
public override object Create(ActorInitializer init) { return new GainsExperience(init, this); }

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)

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string SpeechNotification = null;
[Desc("The text notification to display when the player is low power.")]
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string TextNotification = null;
public override object Create(ActorInitializer init) { return new PowerManager(init.Self, this); }

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play when dropping the unit.")]
public readonly string ReadyAudio = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display when dropping the unit.")]
public readonly string ReadyTextNotification = null;

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits
{
const string CommandName = "custom-terrain";
[TranslationReference]
[FluentReference]
const string CommandDescription = "description-custom-terrain-debug-overlay";
public bool Enabled;

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play when a bridge is repaired.")]
public readonly string RepairNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display when a bridge is repaired.")]
public readonly string RepairTextNotification = null;

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification played when starting to repair a unit.")]
public readonly string StartRepairingNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification displayed when starting to repair a unit.")]
public readonly string StartRepairingTextNotification = null;
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification played when repairing a unit is done.")]
public readonly string FinishRepairingNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification displayed when repairing a unit is done.")]
public readonly string FinishRepairingTextNotification = null;

View File

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

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
public readonly string Notification = "UnitLost";
[Desc("Text notification to display.")]
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string TextNotification = null;
public readonly bool NotifyAll = false;

View File

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

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
[Desc("Speech notification to play to the new owner.")]
public readonly string Notification = "BuildingCaptured";
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display to the new owner.")]
public readonly string TextNotification = null;
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
[Desc("Speech notification to play to the old owner.")]
public readonly string LoseNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display to the old owner.")]
public readonly string LoseTextNotification = null;

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play when entering the drop zone.")]
public readonly string ReinforcementsArrivedSpeechNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display when entering the drop zone.")]
public readonly string ReinforcementsArrivedTextNotification = null;

View File

@@ -32,7 +32,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("Text notification displayed when production is activated.")]
public readonly string ReadyTextNotification = null;
@@ -41,7 +41,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("Text notification displayed when the exit is jammed.")]
public readonly string BlockedTextNotification = null;

View File

@@ -30,10 +30,10 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Palette used for the icon.")]
public readonly string IconPalette = "chrome";
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string Name = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string Description = null;
[Desc("Allow multiple instances of the same support power.")]
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string DetectedSpeechNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string DetectedTextNotification = null;
public readonly string BeginChargeSound = null;
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string BeginChargeSpeechNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string BeginChargeTextNotification = null;
public readonly string EndChargeSound = null;
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string EndChargeSpeechNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string EndChargeTextNotification = null;
public readonly string SelectTargetSound = null;
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string SelectTargetSpeechNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string SelectTargetTextNotification = null;
public readonly string InsufficientPowerSound = null;
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string InsufficientPowerSpeechNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string InsufficientPowerTextNotification = null;
public readonly string LaunchSound = null;
@@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string LaunchSpeechNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string LaunchTextNotification = null;
public readonly string IncomingSound = null;
@@ -109,7 +109,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string IncomingSpeechNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string IncomingTextNotification = null;
[Desc("Defines to which players the timer is shown.")]

View File

@@ -177,8 +177,8 @@ namespace OpenRA.Mods.Common.Traits
Key = key;
TotalTicks = info.ChargeInterval;
remainingSubTicks = info.StartFullyCharged ? 0 : TotalTicks * 100;
Name = info.Name == null ? string.Empty : TranslationProvider.GetString(info.Name);
Description = info.Description == null ? string.Empty : TranslationProvider.GetString(info.Description);
Name = info.Name == null ? string.Empty : FluentProvider.GetString(info.Name);
Description = info.Description == null ? string.Empty : FluentProvider.GetString(info.Description);
Manager = manager;
}

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits
public abstract class TooltipInfoBase : ConditionalTraitInfo, Requires<IMouseBoundsInfo>
{
[FieldLoader.Require]
[TranslationReference]
[FluentReference]
public readonly string Name;
}
@@ -31,22 +31,22 @@ namespace OpenRA.Mods.Common.Traits
{
[Desc("An optional generic name (i.e. \"Soldier\" or \"Structure\")" +
"to be shown to chosen players.")]
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string GenericName;
[Desc("Prefix generic tooltip name with 'Ally/Neutral/EnemyPrefix'.")]
public readonly bool GenericStancePrefix = true;
[Desc("Prefix to display in the tooltip for allied units.")]
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string AllyPrefix = "label-tooltip-prefix.ally";
[Desc("Prefix to display in the tooltip for neutral units.")]
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string NeutralPrefix;
[Desc("Prefix to display in the tooltip for enemy units.")]
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string EnemyPrefix = "label-tooltip-prefix.enemy";
[Desc("Player stances that the generic name should be shown to.")]
@@ -60,19 +60,19 @@ namespace OpenRA.Mods.Common.Traits
public string TooltipForPlayerStance(PlayerRelationship relationship)
{
if (relationship == PlayerRelationship.None || !GenericVisibility.HasRelationship(relationship))
return TranslationProvider.GetString(Name);
return FluentProvider.GetString(Name);
var genericName = string.IsNullOrEmpty(GenericName) ? "" : TranslationProvider.GetString(GenericName);
var genericName = string.IsNullOrEmpty(GenericName) ? "" : FluentProvider.GetString(GenericName);
if (GenericStancePrefix)
{
if (!string.IsNullOrEmpty(AllyPrefix) && relationship == PlayerRelationship.Ally)
return TranslationProvider.GetString(AllyPrefix) + " " + genericName;
return FluentProvider.GetString(AllyPrefix) + " " + genericName;
if (!string.IsNullOrEmpty(NeutralPrefix) && relationship == PlayerRelationship.Neutral)
return TranslationProvider.GetString(NeutralPrefix) + " " + genericName;
return FluentProvider.GetString(NeutralPrefix) + " " + genericName;
if (!string.IsNullOrEmpty(EnemyPrefix) && relationship == PlayerRelationship.Enemy)
return TranslationProvider.GetString(EnemyPrefix) + " " + genericName;
return FluentProvider.GetString(EnemyPrefix) + " " + genericName;
}
return genericName;

View File

@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits
public class TooltipDescriptionInfo : ConditionalTraitInfo
{
[FieldLoader.Require]
[TranslationReference]
[FluentReference]
[Desc("Text shown in tooltip.")]
public readonly string Description;
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
: base(info)
{
this.self = self;
TooltipText = TranslationProvider.GetString(info.Description);
TooltipText = FluentProvider.GetString(info.Description);
}
public bool IsTooltipVisible(Player forPlayer)

View File

@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play when transforming.")]
public readonly string TransformNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display when transforming.")]
public readonly string TransformTextNotification = null;
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Speech notification to play when the transformation is blocked.")]
public readonly string NoTransformNotification = null;
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
[Desc("Text notification to display when the transformation is blocked.")]
public readonly string NoTransformTextNotification = null;

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
{
const string CommandName = "triggers";
[TranslationReference]
[FluentReference]
const string CommandDescription = "description-cell-triggers-overlay";
bool enabled;

View File

@@ -24,13 +24,13 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Configuration options for the lobby player color picker. Attach this to the world actor.")]
public class ColorPickerManagerInfo : TraitInfo<ColorPickerManager>, IColorPickerManagerInfo
{
[TranslationReference]
[FluentReference]
const string PlayerColorTerrain = "notification-player-color-terrain";
[TranslationReference]
[FluentReference]
const string PlayerColorPlayer = "notification-player-color-player";
[TranslationReference]
[FluentReference]
const string InvalidPlayerColor = "notification-invalid-player-color";
[Desc("Minimum and maximum saturation levels that are valid for use.")]

View File

@@ -21,11 +21,11 @@ namespace OpenRA.Mods.Common.Traits
[TraitLocation(SystemActors.World)]
public class CrateSpawnerInfo : TraitInfo, ILobbyOptions
{
[TranslationReference]
[FluentReference]
[Desc("Descriptive label for the crates checkbox in the lobby.")]
public readonly string CheckboxLabel = "checkbox-crates.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the crates checkbox in the lobby.")]
public readonly string CheckboxDescription = "checkbox-crates.description";

View File

@@ -146,12 +146,12 @@ namespace OpenRA.Mods.Common.Traits
sealed class OpenMapAction : IEditorAction
{
[TranslationReference]
[FluentReference]
const string Opened = "notification-opened";
public OpenMapAction()
{
Text = TranslationProvider.GetString(Opened);
Text = FluentProvider.GetString(Opened);
}
public void Execute()

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly ActorInfo Info;
public string Tooltip =>
(tooltip == null ? " < " + Info.Name + " >" : TranslationProvider.GetString(tooltip.Name)) + "\n" + Owner.Name + " (" + Owner.Faction + ")"
(tooltip == null ? " < " + Info.Name + " >" : FluentProvider.GetString(tooltip.Name)) + "\n" + Owner.Name + " (" + Owner.Faction + ")"
+ "\nID: " + ID + "\nType: " + Info.Name;
public string Type => reference.Type;

View File

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits
{
const string CommandName = "exits-overlay";
[TranslationReference]
[FluentReference]
const string CommandDescription = "description-exits-overlay";
public readonly SpriteFont Font;

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
{
const string CommandName = "hpf";
[TranslationReference]
[FluentReference]
const string CommandDescription = "description-hpf-debug-overlay";
readonly HierarchicalPathFinderOverlayInfo info;

View File

@@ -18,11 +18,11 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Controls the build radius checkboxes in the lobby options.")]
public class MapBuildRadiusInfo : TraitInfo, ILobbyOptions
{
[TranslationReference]
[FluentReference]
[Desc("Descriptive label for the ally build radius checkbox in the lobby.")]
public readonly string AllyBuildRadiusCheckboxLabel = "checkbox-ally-build-radius.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the ally build radius checkbox in the lobby.")]
public readonly string AllyBuildRadiusCheckboxDescription = "checkbox-ally-build-radius.description";
@@ -38,11 +38,11 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Display order for the ally build radius checkbox in the lobby.")]
public readonly int AllyBuildRadiusCheckboxDisplayOrder = 0;
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the build radius checkbox in the lobby.")]
public readonly string BuildRadiusCheckboxLabel = "checkbox-build-radius.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the build radius checkbox in the lobby.")]
public readonly string BuildRadiusCheckboxDescription = "checkbox-build-radius.description";

View File

@@ -18,11 +18,11 @@ namespace OpenRA.Mods.Common.Traits
[TraitLocation(SystemActors.World)]
public class MapCreepsInfo : TraitInfo, ILobbyOptions
{
[TranslationReference]
[FluentReference]
[Desc("Descriptive label for the creeps checkbox in the lobby.")]
public readonly string CheckboxLabel = "dropdown-map-creeps.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the creeps checkbox in the lobby.")]
public readonly string CheckboxDescription = "dropdown-map-creeps.description";

View File

@@ -19,11 +19,11 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Controls the game speed, tech level, and short game lobby options.")]
public class MapOptionsInfo : TraitInfo, ILobbyOptions, IRulesetLoaded
{
[TranslationReference]
[FluentReference]
[Desc("Descriptive label for the short game checkbox in the lobby.")]
public readonly string ShortGameCheckboxLabel = "checkbox-short-game.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the short game checkbox in the lobby.")]
public readonly string ShortGameCheckboxDescription = "checkbox-short-game.description";
@@ -39,11 +39,11 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Display order for the short game checkbox in the lobby.")]
public readonly int ShortGameCheckboxDisplayOrder = 0;
[TranslationReference]
[FluentReference]
[Desc("Descriptive label for the tech level option in the lobby.")]
public readonly string TechLevelDropdownLabel = "dropdown-tech-level.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the tech level option in the lobby.")]
public readonly string TechLevelDropdownDescription = "dropdown-tech-level.description";
@@ -59,11 +59,11 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Display order for the tech level option in the lobby.")]
public readonly int TechLevelDropdownDisplayOrder = 0;
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the game speed option in the lobby.")]
public readonly string GameSpeedDropdownLabel = "dropdown-game-speed.label";
[TranslationReference]
[FluentReference]
[Desc("Description of the game speed option in the lobby.")]
public readonly string GameSpeedDropdownDescription = "dropdown-game-speed.description";
@@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits
techLevels, TechLevel, TechLevelDropdownLocked);
var gameSpeeds = Game.ModData.Manifest.Get<GameSpeeds>();
var speeds = gameSpeeds.Speeds.ToDictionary(s => s.Key, s => TranslationProvider.GetString(s.Value.Name));
var speeds = gameSpeeds.Speeds.ToDictionary(s => s.Key, s => FluentProvider.GetString(s.Value.Name));
// NOTE: This is just exposing the UI, the backend logic for this option is hardcoded in World.
yield return new LobbyOption(map, "gamespeed",

View File

@@ -25,11 +25,11 @@ namespace OpenRA.Mods.Common.Traits
{
public readonly WDist InitialExploreRange = WDist.FromCells(5);
[TranslationReference]
[FluentReference]
[Desc("Descriptive label for the spawn positions checkbox in the lobby.")]
public readonly string SeparateTeamSpawnsCheckboxLabel = "checkbox-separate-team-spawns.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the spawn positions checkbox in the lobby.")]
public readonly string SeparateTeamSpawnsCheckboxDescription = "checkbox-separate-team-spawns.description";

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Internal class ID.")]
public readonly string Class = "none";
[TranslationReference]
[FluentReference]
[Desc("Exposed via the UI to the player.")]
public readonly string ClassName = "Unlabeled";

View File

@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits
{
const string CommandName = "path-debug";
[TranslationReference]
[FluentReference]
const string CommandDescription = "description-path-debug-overlay";
sealed class Record : PathSearch.IRecorder, IEnumerable<(CPos Source, CPos Destination, int CostSoFar, int EstimatedRemainingCost)>

View File

@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
[FieldLoader.Require]
[Desc("Resource name used by tooltips.")]
[TranslationReference]
[FluentReference]
public readonly string Name = null;
public ResourceTypeInfo(MiniYaml yaml)
@@ -273,7 +273,7 @@ namespace OpenRA.Mods.Common.Traits
if (info == null)
return null;
return TranslationProvider.GetString(info.Name);
return FluentProvider.GetString(info.Name);
}
IEnumerable<string> IResourceRenderer.ResourceTypes => Info.ResourceTypes.Keys;

View File

@@ -23,11 +23,11 @@ namespace OpenRA.Mods.Common.Traits
public readonly string ID = null;
[FieldLoader.Require]
[TranslationReference]
[FluentReference]
[Desc("Descriptive label for this option.")]
public readonly string Label = null;
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for this option.")]
public readonly string Description = null;
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string Default = null;
[FieldLoader.Require]
[TranslationReference(dictionaryReference: LintDictionaryReference.Values)]
[FluentReference(dictionaryReference: LintDictionaryReference.Values)]
[Desc("Options to choose from.")]
public readonly Dictionary<string, string> Values = null;

View File

@@ -25,11 +25,11 @@ namespace OpenRA.Mods.Common.Traits
{
public readonly string StartingUnitsClass = "none";
[TranslationReference]
[FluentReference]
[Desc("Descriptive label for the starting units option in the lobby.")]
public readonly string DropdownLabel = "dropdown-starting-units.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description for the starting units option in the lobby.")]
public readonly string DropdownDescription = "dropdown-starting-units.description";

View File

@@ -20,19 +20,19 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string Notification = "StartGame";
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string TextNotification = null;
[NotificationReference("Speech")]
public readonly string LoadedNotification = "GameLoaded";
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string LoadedTextNotification = null;
[NotificationReference("Speech")]
public readonly string SavedNotification = "GameSaved";
[TranslationReference(optional: true)]
[FluentReference(optional: true)]
public readonly string SavedTextNotification = null;
public override object Create(ActorInitializer init) { return new StartGameNotification(this); }

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
{
const string CommandName = "terrain-geometry";
[TranslationReference]
[FluentReference]
const string CommandDescription = "description-terrain-geometry-overlay";
public bool Enabled;

View File

@@ -22,11 +22,11 @@ namespace OpenRA.Mods.Common.Traits
[Desc("This trait allows setting a time limit on matches. Attach this to the World actor.")]
public class TimeLimitManagerInfo : TraitInfo, ILobbyOptions, IRulesetLoaded
{
[TranslationReference]
[FluentReference]
[Desc("Label that will be shown for the time limit option in the lobby.")]
public readonly string TimeLimitLabel = "dropdown-time-limit.label";
[TranslationReference]
[FluentReference]
[Desc("Tooltip description that will be shown for the time limit option in the lobby.")]
public readonly string TimeLimitDescription = "dropdown-time-limit.description";
@@ -77,10 +77,10 @@ namespace OpenRA.Mods.Common.Traits
throw new YamlException("TimeLimitDefault must be a value from TimeLimitOptions");
}
[TranslationReference]
[FluentReference]
const string NoTimeLimit = "options-time-limit.no-limit";
[TranslationReference("minutes")]
[FluentReference("minutes")]
const string TimeLimitOption = "options-time-limit.options";
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
@@ -88,9 +88,9 @@ namespace OpenRA.Mods.Common.Traits
var timelimits = TimeLimitOptions.ToDictionary(m => m.ToStringInvariant(), m =>
{
if (m == 0)
return TranslationProvider.GetString(NoTimeLimit);
return FluentProvider.GetString(NoTimeLimit);
else
return TranslationProvider.GetString(TimeLimitOption, Translation.Arguments("minutes", m));
return FluentProvider.GetString(TimeLimitOption, FluentBundle.Arguments("minutes", m));
});
yield return new LobbyOption(map, "timelimit", TimeLimitLabel, TimeLimitDescription, TimeLimitDropdownVisible, TimeLimitDisplayOrder,
@@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Traits
public class TimeLimitManager : INotifyTimeLimit, ITick, IWorldLoaded
{
[TranslationReference]
[FluentReference]
const string TimeLimitExpired = "notification-time-limit-expired";
readonly TimeLimitManagerInfo info;
@@ -182,7 +182,7 @@ namespace OpenRA.Mods.Common.Traits
countdownLabel.GetText = () => null;
if (!info.SkipTimerExpiredNotification)
TextNotificationsManager.AddSystemLine(TranslationProvider.GetString(TimeLimitExpired));
TextNotificationsManager.AddSystemLine(FluentProvider.GetString(TimeLimitExpired));
}
}
}