From d4a08e5b58e0f7b79e698b351e7facbcff46b3ee Mon Sep 17 00:00:00 2001 From: Gustas <37534529+PunkPun@users.noreply.github.com> Date: Sat, 19 Apr 2025 13:24:27 +0300 Subject: [PATCH] Switch to count naming --- .../EditorBrushes/EditorCopyPasteBrush.cs | 4 ++-- .../EditorBrushes/EditorMarkerLayerBrush.cs | 19 +++++++++--------- .../EditorBrushes/EditorResourceBrush.cs | 4 ++-- mods/common/fluent/common.ftl | 20 +++++++++---------- 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs index 8221b1be31..3fa07079d3 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs @@ -120,7 +120,7 @@ namespace OpenRA.Mods.Common.Widgets sealed class CopyPasteEditorAction : IEditorAction { - [FluentReference("amount")] + [FluentReference("count")] const string CopiedTiles = "notification-copied-tiles"; public string Text { get; } @@ -131,7 +131,7 @@ namespace OpenRA.Mods.Common.Widgets { this.editorBlit = editorBlit; - Text = FluentProvider.GetMessage(CopiedTiles, "amount", editorBlit.TileCount()); + Text = FluentProvider.GetMessage(CopiedTiles, "count", editorBlit.TileCount()); } public void Execute() diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorMarkerLayerBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorMarkerLayerBrush.cs index e3b2e5e9bc..09352f0d35 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorMarkerLayerBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorMarkerLayerBrush.cs @@ -98,10 +98,10 @@ namespace OpenRA.Mods.Common.Widgets sealed class PaintMarkerTileEditorAction : IEditorAction { - [FluentReference("amount", "type")] + [FluentReference("count", "type")] const string AddedMarkerTiles = "notification-added-marker-tiles"; - [FluentReference("amount")] + [FluentReference("count")] const string RemovedMarkerTiles = "notification-removed-marker-tiles"; public string Text { get; private set; } @@ -150,16 +150,15 @@ namespace OpenRA.Mods.Common.Widgets markerLayerOverlay.SetTile(cell, type); } - if (type != null) - Text = FluentProvider.GetMessage(AddedMarkerTiles, "amount", paintTiles.Count, "type", type); - else - Text = FluentProvider.GetMessage(RemovedMarkerTiles, "amount", paintTiles.Count); + Text = type != null + ? FluentProvider.GetMessage(AddedMarkerTiles, "count", paintTiles.Count, "type", type) + : FluentProvider.GetMessage(RemovedMarkerTiles, "count", paintTiles.Count); } } sealed class ClearSelectedMarkerTilesEditorAction : IEditorAction { - [FluentReference("amount", "type")] + [FluentReference("count", "type")] const string ClearedSelectedMarkerTiles = "notification-cleared-selected-marker-tiles"; public string Text { get; } @@ -177,7 +176,7 @@ namespace OpenRA.Mods.Common.Widgets tiles = markerLayerOverlay.Tiles[tile].ToHashSet(); - Text = FluentProvider.GetMessage(ClearedSelectedMarkerTiles, "amount", tiles.Count, "type", tile); + Text = FluentProvider.GetMessage(ClearedSelectedMarkerTiles, "count", tiles.Count, "type", tile); } public void Execute() @@ -198,7 +197,7 @@ namespace OpenRA.Mods.Common.Widgets sealed class ClearAllMarkerTilesEditorAction : IEditorAction { - [FluentReference("amount")] + [FluentReference("count")] const string ClearedAllMarkerTiles = "notification-cleared-all-marker-tiles"; public string Text { get; } @@ -214,7 +213,7 @@ namespace OpenRA.Mods.Common.Widgets var allTilesCount = tiles.Values.Sum(x => x.Count); - Text = FluentProvider.GetMessage(ClearedAllMarkerTiles, "amount", allTilesCount); + Text = FluentProvider.GetMessage(ClearedAllMarkerTiles, "count", allTilesCount); } public void Execute() diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs index bff88f0256..4bdbeb1157 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs @@ -113,7 +113,7 @@ namespace OpenRA.Mods.Common.Widgets sealed class AddResourcesEditorAction : IEditorAction { - [FluentReference("amount", "type")] + [FluentReference("count", "type")] const string AddedResource = "notification-added-resource"; public string Text { get; private set; } @@ -157,7 +157,7 @@ namespace OpenRA.Mods.Common.Widgets resourceLayer.ClearResources(resourceCell.Cell); resourceLayer.AddResource(resourceCell.NewResourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceCell.NewResourceType)); cellResources.Add(resourceCell); - Text = FluentProvider.GetMessage(AddedResource, "amount", cellResources.Count, "type", resourceType); + Text = FluentProvider.GetMessage(AddedResource, "count", cellResources.Count, "type", resourceType); } } } diff --git a/mods/common/fluent/common.ftl b/mods/common/fluent/common.ftl index 21daa3fe62..c3c764dd16 100644 --- a/mods/common/fluent/common.ftl +++ b/mods/common/fluent/common.ftl @@ -783,9 +783,9 @@ notification-added-actor = Added { $name } ({ $id }) ## EditorCopyPasteBrush notification-copied-tiles = - { $amount -> + { $count -> [one] Copied one tile - *[other] Copied { $amount } tiles + *[other] Copied { $count } tiles } ## EditorDefaultBrush @@ -799,9 +799,9 @@ notification-moved-actor = Moved { $id } from { $x1 },{ $y1 } to { $x2 },{ $y2 } ## EditorResourceBrush notification-added-resource = - { $amount -> + { $count -> [one] Added one cell of { $type } - *[other] Added { $amount } cells of { $type } + *[other] Added { $count } cells of { $type } } ## EditorTileBrush @@ -810,17 +810,17 @@ notification-filled-tile = Filled with tile { $id } ## EditorMarkerLayerBrush notification-added-marker-tiles = - { $amount -> + { $count -> [one] Added one marker tile of type { $type } - *[other] Added { $amount } marker tiles of type { $type } + *[other] Added { $count } marker tiles of type { $type } } notification-removed-marker-tiles = - { $amount -> + { $count -> [one] Removed one marker tile - *[other] Removed { $amount } marker tiles + *[other] Removed { $count } marker tiles } -notification-cleared-selected-marker-tiles = Cleared { $amount } marker tiles of type { $type } -notification-cleared-all-marker-tiles = Cleared { $amount } marker tiles +notification-cleared-selected-marker-tiles = Cleared { $count } marker tiles of type { $type } +notification-cleared-all-marker-tiles = Cleared { $count } marker tiles ## EditorActionManager notification-opened = Opened