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

@@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Widgets
{
public string Text { get; private set; }
[TranslationReference("name", "id")]
[FluentReference("name", "id")]
const string AddedActor = "notification-added-actor";
readonly EditorActorLayer editorLayer;
@@ -167,8 +167,8 @@ namespace OpenRA.Mods.Common.Widgets
public void Do()
{
editorActorPreview = editorLayer.Add(actor);
Text = TranslationProvider.GetString(AddedActor,
Translation.Arguments("name", editorActorPreview.Info.Name, "id", editorActorPreview.ID));
Text = FluentProvider.GetString(AddedActor,
FluentBundle.Arguments("name", editorActorPreview.Info.Name, "id", editorActorPreview.ID));
}
public void Undo()

View File

@@ -116,7 +116,7 @@ namespace OpenRA.Mods.Common.Widgets
sealed class CopyPasteEditorAction : IEditorAction
{
[TranslationReference("amount")]
[FluentReference("amount")]
const string CopiedTiles = "notification-copied-tiles";
public string Text { get; }
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Widgets
undoClipboard = CopySelectionContents();
Text = TranslationProvider.GetString(CopiedTiles, Translation.Arguments("amount", clipboard.Tiles.Count));
Text = FluentProvider.GetString(CopiedTiles, FluentBundle.Arguments("amount", clipboard.Tiles.Count));
}
/// <summary>

View File

@@ -279,13 +279,13 @@ namespace OpenRA.Mods.Common.Widgets
sealed class ChangeSelectionAction : IEditorAction
{
[TranslationReference("x", "y", "width", "height")]
[FluentReference("x", "y", "width", "height")]
const string SelectedArea = "notification-selected-area";
[TranslationReference("id")]
[FluentReference("id")]
const string SelectedActor = "notification-selected-actor";
[TranslationReference]
[FluentReference]
const string ClearedSelection = "notification-cleared-selection";
public string Text { get; }
@@ -308,15 +308,15 @@ namespace OpenRA.Mods.Common.Widgets
};
if (selection.Area != null)
Text = TranslationProvider.GetString(SelectedArea, Translation.Arguments(
Text = FluentProvider.GetString(SelectedArea, FluentBundle.Arguments(
"x", selection.Area.TopLeft.X,
"y", selection.Area.TopLeft.Y,
"width", selection.Area.BottomRight.X - selection.Area.TopLeft.X,
"height", selection.Area.BottomRight.Y - selection.Area.TopLeft.Y));
else if (selection.Actor != null)
Text = TranslationProvider.GetString(SelectedActor, Translation.Arguments("id", selection.Actor.ID));
Text = FluentProvider.GetString(SelectedActor, FluentBundle.Arguments("id", selection.Actor.ID));
else
Text = TranslationProvider.GetString(ClearedSelection);
Text = FluentProvider.GetString(ClearedSelection);
}
public void Execute()
@@ -337,7 +337,7 @@ namespace OpenRA.Mods.Common.Widgets
sealed class RemoveSelectedActorAction : IEditorAction
{
[TranslationReference("name", "id")]
[FluentReference("name", "id")]
const string RemovedActor = "notification-removed-actor";
public string Text { get; }
@@ -360,8 +360,8 @@ namespace OpenRA.Mods.Common.Widgets
Actor = defaultBrush.Selection.Actor
};
Text = TranslationProvider.GetString(RemovedActor,
Translation.Arguments("name", actor.Info.Name, "id", actor.ID));
Text = FluentProvider.GetString(RemovedActor,
FluentBundle.Arguments("name", actor.Info.Name, "id", actor.ID));
}
public void Execute()
@@ -384,7 +384,7 @@ namespace OpenRA.Mods.Common.Widgets
sealed class RemoveActorAction : IEditorAction
{
[TranslationReference("name", "id")]
[FluentReference("name", "id")]
const string RemovedActor = "notification-removed-actor";
public string Text { get; }
@@ -397,8 +397,8 @@ namespace OpenRA.Mods.Common.Widgets
this.editorActorLayer = editorActorLayer;
this.actor = actor;
Text = TranslationProvider.GetString(RemovedActor,
Translation.Arguments("name", actor.Info.Name, "id", actor.ID));
Text = FluentProvider.GetString(RemovedActor,
FluentBundle.Arguments("name", actor.Info.Name, "id", actor.ID));
}
public void Execute()
@@ -419,7 +419,7 @@ namespace OpenRA.Mods.Common.Widgets
sealed class MoveActorAction : IEditorAction
{
[TranslationReference("id", "x1", "y1", "x2", "y2")]
[FluentReference("id", "x1", "y1", "x2", "y2")]
const string MovedActor = "notification-moved-actor";
public string Text { get; private set; }
@@ -466,13 +466,13 @@ namespace OpenRA.Mods.Common.Widgets
to = worldRenderer.Viewport.ViewToWorld(pixelTo + pixelOffset) + cellOffset;
layer.MoveActor(actor, to);
Text = TranslationProvider.GetString(MovedActor, Translation.Arguments("id", actor.ID, "x1", from.X, "y1", from.Y, "x2", to.X, "y2", to.Y));
Text = FluentProvider.GetString(MovedActor, FluentBundle.Arguments("id", actor.ID, "x1", from.X, "y1", from.Y, "x2", to.X, "y2", to.Y));
}
}
sealed class RemoveResourceAction : IEditorAction
{
[TranslationReference("type")]
[FluentReference("type")]
const string RemovedResource = "notification-removed-resource";
public string Text { get; }
@@ -487,7 +487,7 @@ namespace OpenRA.Mods.Common.Widgets
this.resourceLayer = resourceLayer;
this.cell = cell;
Text = TranslationProvider.GetString(RemovedResource, Translation.Arguments("type", resourceType));
Text = FluentProvider.GetString(RemovedResource, FluentBundle.Arguments("type", resourceType));
}
public void Execute()

View File

@@ -98,10 +98,10 @@ namespace OpenRA.Mods.Common.Widgets
class PaintMarkerTileEditorAction : IEditorAction
{
[TranslationReference("amount", "type")]
[FluentReference("amount", "type")]
const string AddedMarkerTiles = "notification-added-marker-tiles";
[TranslationReference("amount")]
[FluentReference("amount")]
const string RemovedMarkerTiles = "notification-removed-marker-tiles";
public string Text { get; private set; }
@@ -150,15 +150,15 @@ namespace OpenRA.Mods.Common.Widgets
}
if (type != null)
Text = TranslationProvider.GetString(AddedMarkerTiles, Translation.Arguments("amount", paintTiles.Count, "type", type));
Text = FluentProvider.GetString(AddedMarkerTiles, FluentBundle.Arguments("amount", paintTiles.Count, "type", type));
else
Text = TranslationProvider.GetString(RemovedMarkerTiles, Translation.Arguments("amount", paintTiles.Count));
Text = FluentProvider.GetString(RemovedMarkerTiles, FluentBundle.Arguments("amount", paintTiles.Count));
}
}
class ClearSelectedMarkerTilesEditorAction : IEditorAction
{
[TranslationReference("amount", "type")]
[FluentReference("amount", "type")]
const string ClearedSelectedMarkerTiles = "notification-cleared-selected-marker-tiles";
public string Text { get; }
@@ -176,7 +176,7 @@ namespace OpenRA.Mods.Common.Widgets
tiles = new HashSet<CPos>(markerLayerOverlay.Tiles[tile]);
Text = TranslationProvider.GetString(ClearedSelectedMarkerTiles, Translation.Arguments("amount", tiles.Count, "type", tile));
Text = FluentProvider.GetString(ClearedSelectedMarkerTiles, FluentBundle.Arguments("amount", tiles.Count, "type", tile));
}
public void Execute()
@@ -197,7 +197,7 @@ namespace OpenRA.Mods.Common.Widgets
class ClearAllMarkerTilesEditorAction : IEditorAction
{
[TranslationReference("amount")]
[FluentReference("amount")]
const string ClearedAllMarkerTiles = "notification-cleared-all-marker-tiles";
public string Text { get; }
@@ -213,7 +213,7 @@ namespace OpenRA.Mods.Common.Widgets
var allTilesCount = tiles.Values.Select(x => x.Count).Sum();
Text = TranslationProvider.GetString(ClearedAllMarkerTiles, Translation.Arguments("amount", allTilesCount));
Text = FluentProvider.GetString(ClearedAllMarkerTiles, FluentBundle.Arguments("amount", allTilesCount));
}
public void Execute()

View File

@@ -125,7 +125,7 @@ namespace OpenRA.Mods.Common.Widgets
sealed class AddResourcesEditorAction : IEditorAction
{
[TranslationReference("amount", "type")]
[FluentReference("amount", "type")]
const string AddedResource = "notification-added-resource";
public string Text { get; private set; }
@@ -168,7 +168,7 @@ namespace OpenRA.Mods.Common.Widgets
resourceLayer.ClearResources(resourceCell.Cell);
resourceLayer.AddResource(resourceCell.NewResourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceCell.NewResourceType));
cellResources.Add(resourceCell);
Text = TranslationProvider.GetString(AddedResource, Translation.Arguments("amount", cellResources.Count, "type", resourceType));
Text = FluentProvider.GetString(AddedResource, FluentBundle.Arguments("amount", cellResources.Count, "type", resourceType));
}
}
}

View File

@@ -172,7 +172,7 @@ namespace OpenRA.Mods.Common.Widgets
sealed class PaintTileEditorAction : IEditorAction
{
[TranslationReference("id")]
[FluentReference("id")]
const string AddedTile = "notification-added-tile";
public string Text { get; }
@@ -192,7 +192,7 @@ namespace OpenRA.Mods.Common.Widgets
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
terrainTemplate = terrainInfo.Templates[template];
Text = TranslationProvider.GetString(AddedTile, Translation.Arguments("id", terrainTemplate.Id));
Text = FluentProvider.GetString(AddedTile, FluentBundle.Arguments("id", terrainTemplate.Id));
}
public void Execute()
@@ -244,7 +244,7 @@ namespace OpenRA.Mods.Common.Widgets
sealed class FloodFillEditorAction : IEditorAction
{
[TranslationReference("id")]
[FluentReference("id")]
const string FilledTile = "notification-filled-tile";
public string Text { get; }
@@ -264,7 +264,7 @@ namespace OpenRA.Mods.Common.Widgets
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
terrainTemplate = terrainInfo.Templates[template];
Text = TranslationProvider.GetString(FilledTile, Translation.Arguments("id", terrainTemplate.Id));
Text = FluentProvider.GetString(FilledTile, FluentBundle.Arguments("id", terrainTemplate.Id));
}
public void Execute()