diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs index 4e910c01fc..bfc78535f5 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs @@ -81,6 +81,9 @@ namespace OpenRA.Mods.Common.Widgets { public string Text { get; private set; } + [TranslationReference("name", "id")] + const string AddedActor = "notification-added-actor"; + readonly EditorActorLayer editorLayer; readonly ActorReference actor; @@ -102,7 +105,8 @@ namespace OpenRA.Mods.Common.Widgets public void Do() { editorActorPreview = editorLayer.Add(actor); - Text = $"Added {editorActorPreview.Info.Name} ({editorActorPreview.ID})"; + Text = TranslationProvider.GetString(AddedActor, + Translation.Arguments("name", editorActorPreview.Info.Name, "id", editorActorPreview.ID)); } public void Undo() diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs index d9e9af2f8f..fca429f84e 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs @@ -176,6 +176,9 @@ namespace OpenRA.Mods.Common.Widgets class CopyPasteEditorAction : IEditorAction { + [TranslationReference("amount")] + const string CopiedTiles = "notification-copied-tiles"; + public string Text { get; } readonly MapCopyFilters copyFilters; @@ -205,7 +208,7 @@ namespace OpenRA.Mods.Common.Widgets mapHeight = map.Height; mapResources = map.Resources; - Text = $"Copied {tiles.Count} tiles"; + Text = TranslationProvider.GetString(CopiedTiles, Translation.Arguments("amount", tiles.Count)); } public void Execute() diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs index bd278499ce..7e186c93cf 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs @@ -110,6 +110,9 @@ namespace OpenRA.Mods.Common.Widgets class RemoveActorAction : IEditorAction { + [TranslationReference("name", "id")] + const string RemovedActor = "notification-removed-actor"; + public string Text { get; } readonly EditorActorLayer editorActorLayer; @@ -120,7 +123,8 @@ namespace OpenRA.Mods.Common.Widgets this.editorActorLayer = editorActorLayer; this.actor = actor; - Text = $"Removed {actor.Info.Name} ({actor.ID})"; + Text = TranslationProvider.GetString(RemovedActor, + Translation.Arguments("name", actor.Info.Name, "id", actor.ID)); } public void Execute() @@ -141,6 +145,9 @@ namespace OpenRA.Mods.Common.Widgets class RemoveResourceAction : IEditorAction { + [TranslationReference("type")] + const string RemovedResource = "notification-removed-resource"; + public string Text { get; } readonly IResourceLayer resourceLayer; @@ -153,7 +160,7 @@ namespace OpenRA.Mods.Common.Widgets this.resourceLayer = resourceLayer; this.cell = cell; - Text = $"Removed {resourceType}"; + Text = TranslationProvider.GetString(RemovedResource, Translation.Arguments("type", resourceType)); } public void Execute() diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs index 917e7ea059..e742413683 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs @@ -105,6 +105,9 @@ namespace OpenRA.Mods.Common.Widgets class AddResourcesEditorAction : IEditorAction { + [TranslationReference("amount", "type")] + const string AddedResource = "notification-added-resource"; + public string Text { get; private set; } readonly IResourceLayer resourceLayer; @@ -145,9 +148,7 @@ namespace OpenRA.Mods.Common.Widgets resourceLayer.ClearResources(resourceCell.Cell); resourceLayer.AddResource(resourceCell.NewResourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceCell.NewResourceType)); cellResources.Add(resourceCell); - - var cellText = cellResources.Count != 1 ? "cells" : "cell"; - Text = $"Added {cellResources.Count} {cellText} of {resourceType}"; + Text = TranslationProvider.GetString(AddedResource, Translation.Arguments("amount", cellResources.Count, "type", resourceType)); } } } diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs index 616079ebc6..16fea4d388 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs @@ -155,6 +155,9 @@ namespace OpenRA.Mods.Common.Widgets class PaintTileEditorAction : IEditorAction { + [TranslationReference("id")] + const string AddedTile = "notification-added-tile"; + public string Text { get; } readonly ushort template; @@ -172,7 +175,7 @@ namespace OpenRA.Mods.Common.Widgets var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo; terrainTemplate = terrainInfo.Templates[template]; - Text = $"Added tile {terrainTemplate.Id}"; + Text = TranslationProvider.GetString(AddedTile, Translation.Arguments("id", terrainTemplate.Id)); } public void Execute() @@ -224,6 +227,9 @@ namespace OpenRA.Mods.Common.Widgets class FloodFillEditorAction : IEditorAction { + [TranslationReference("id")] + const string FilledTile = "notification-filled-tile"; + public string Text { get; } readonly ushort template; @@ -241,7 +247,7 @@ namespace OpenRA.Mods.Common.Widgets var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo; terrainTemplate = terrainInfo.Templates[template]; - Text = $"Filled with tile {terrainTemplate.Id}"; + Text = TranslationProvider.GetString(FilledTile, Translation.Arguments("id", terrainTemplate.Id)); } public void Execute() diff --git a/OpenRA.Mods.Common/Traits/World/EditorActionManager.cs b/OpenRA.Mods.Common/Traits/World/EditorActionManager.cs index 608853310a..1bcdc8d2f8 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorActionManager.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorActionManager.cs @@ -146,9 +146,12 @@ namespace OpenRA.Mods.Common.Traits class OpenMapAction : IEditorAction { + [TranslationReference] + const string Opened = "notification-opened"; + public OpenMapAction() { - Text = "Opened"; + Text = TranslationProvider.GetString(Opened); } public void Execute() diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs index 6d40fa7841..e50f5f8986 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs @@ -463,6 +463,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic class EditActorEditorAction : IEditorAction { + [TranslationReference("name", "id")] + const string EditedActor = "notification-edited-actor"; + public string Text { get; } readonly IEnumerable handles; @@ -476,7 +479,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic actorId = actor.ID; this.actor = actor; this.handles = handles; - Text = $"Edited {actor.Info.Name} ({actor.ID})"; + Text = TranslationProvider.GetString(EditedActor, Translation.Arguments("name", actor.Info.Name, "id", actor.ID)); } public void Execute() diff --git a/mods/common/languages/en.ftl b/mods/common/languages/en.ftl index d524ed2590..e74c12e2e9 100644 --- a/mods/common/languages/en.ftl +++ b/mods/common/languages/en.ftl @@ -717,3 +717,34 @@ options-time-limit = } notification-time-limit-expired = Time limit has expired. + +## EditorActorBrush +notification-added-actor = Added { $name } ({ $id }) + +## EditorCopyPasteBrush +notification-copied-tiles = + { $amount -> + [one] Copied one tile + *[other] Copied { $amount } tiles + } + +## EditorDefaultBrush +notification-removed-actor = Removed { $name } ({ $id }) +notification-removed-resource = Removed { $type } + +## EditorResourceBrush +notification-added-resource = + { $amount -> + [one] Added one cell of { $type } + *[other] Added { $amount } cells of { $type } + } + +## EditorTileBrush +notification-added-tile = Added tile { $id } +notification-filled-tile = Filled with tile { $id } + +## EditorActionManager +notification-opened = Opened + +## ActorEditLogic +notification-edited-actor = Edited { $name } ({ $id })