Extract translation strings.

This commit is contained in:
Matthias Mailänder
2022-08-10 22:43:22 +02:00
committed by teinarss
parent 8201a57b10
commit cc58fe1a0f
17 changed files with 314 additions and 73 deletions

View File

@@ -42,11 +42,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
readonly ActorSelectorActor[] allActors;
readonly EditorCursorLayer editorCursor;
[TranslationReference]
static readonly string Type = "type";
PlayerReference selectedOwner;
[ObjectCreator.UseCtor]
public ActorSelectorLogic(Widget widget, World world, WorldRenderer worldRenderer)
: base(widget, world, worldRenderer, "ACTORTEMPLATE_LIST", "ACTORPREVIEW_TEMPLATE")
public ActorSelectorLogic(Widget widget, ModData modData, World world, WorldRenderer worldRenderer)
: base(widget, modData, world, worldRenderer, "ACTORTEMPLATE_LIST", "ACTORPREVIEW_TEMPLATE")
{
mapRules = world.Map.Rules;
ownersDropDown = widget.Get<DropDownButtonWidget>("OWNERS_DROPDOWN");
@@ -112,7 +115,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (tooltip != null)
searchTerms.Add(tooltip.Name);
var tooltipText = (tooltip == null ? "Type: " : tooltip.Name + "\nType: ") + a.Name;
var type = modData.Translation.GetString(Type);
var tooltipText = (tooltip == null ? $"{type}: " : tooltip.Name + $"\n{type}: ") + a.Name;
allActorsTemp.Add(new ActorSelectorActor(a, editorData.Categories, searchTerms.ToArray(), tooltipText));
}