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

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public class ProductionTooltipLogic : ChromeLogic
{
[TranslationReference("prequisites")]
[FluentReference("prequisites")]
const string Requires = "label-requires";
[ObjectCreator.UseCtor]
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
return;
var tooltip = actor.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
var name = tooltip != null ? TranslationProvider.GetString(tooltip.Name) : actor.Name;
var name = tooltip != null ? FluentProvider.GetString(tooltip.Name) : actor.Name;
var buildable = actor.TraitInfo<BuildableInfo>();
var cost = 0;
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var requiresSize = int2.Zero;
if (prereqs.Count > 0)
{
var requiresText = TranslationProvider.GetString(Requires, Translation.Arguments("prequisites", prereqs.JoinWith(", ")));
var requiresText = FluentProvider.GetString(Requires, FluentBundle.Arguments("prequisites", prereqs.JoinWith(", ")));
requiresLabel.GetText = () => requiresText;
requiresSize = requiresFont.Measure(requiresText);
requiresLabel.Visible = true;
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
costLabel.GetColor = () => pr.GetCashAndResources() >= cost ? Color.White : Color.Red;
var costSize = font.Measure(costText);
var desc = string.IsNullOrEmpty(buildable.Description) ? "" : TranslationProvider.GetString(buildable.Description);
var desc = string.IsNullOrEmpty(buildable.Description) ? "" : FluentProvider.GetString(buildable.Description);
descLabel.GetText = () => desc;
var descSize = descFont.Measure(desc);
descLabel.Bounds.Width = descSize.X;
@@ -180,7 +180,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
var actorTooltip = ai.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
if (actorTooltip != null)
return TranslationProvider.GetString(actorTooltip.Name);
return FluentProvider.GetString(actorTooltip.Name);
}
return a;