Extract strings from support power name and description.

This commit is contained in:
Matthias Mailänder
2024-04-02 11:58:57 +02:00
committed by Gustas
parent 0c43801a2c
commit 188f0e2451
25 changed files with 174 additions and 68 deletions

View File

@@ -21,8 +21,10 @@ namespace OpenRA.Mods.Common.Widgets
{
public class SupportPowerTimerWidget : Widget
{
[TranslationReference("player", "support-power", "time")]
const string Format = "support-power-timer";
public readonly string Font = "Bold";
public readonly string Format = "{0}'s {1}: {2}";
public readonly TextAlign Align = TextAlign.Left;
public readonly TimerOrder Order = TimerOrder.Descending;
@@ -57,7 +59,9 @@ namespace OpenRA.Mods.Common.Widgets
{
var self = p.Instances[0].Self;
var time = WidgetUtils.FormatTime(p.RemainingTicks, false, self.World.Timestep);
var text = Format.FormatCurrent(self.Owner.PlayerName, p.Info.Name, time);
var supportPowerName = TranslationProvider.GetString(p.Info.Name);
var text = TranslationProvider.GetString(Format, Translation.Arguments("player", self.Owner.PlayerName, "support-power", supportPowerName, "time", time));
var playerColor = self.Owner.Color;
if (Game.Settings.Game.UsePlayerStanceColors)