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

@@ -22,61 +22,61 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public class InstallFromSourceLogic : ChromeLogic
{
[TranslationReference]
[FluentReference]
const string DetectingSources = "label-detecting-sources";
[TranslationReference]
[FluentReference]
const string CheckingSources = "label-checking-sources";
[TranslationReference("title")]
[FluentReference("title")]
const string SearchingSourceFor = "label-searching-source-for";
[TranslationReference]
[FluentReference]
const string ContentPackageInstallation = "label-content-package-installation";
[TranslationReference]
[FluentReference]
const string GameSources = "label-game-sources";
[TranslationReference]
[FluentReference]
const string DigitalInstalls = "label-digital-installs";
[TranslationReference]
[FluentReference]
const string GameContentNotFound = "label-game-content-not-found";
[TranslationReference]
[FluentReference]
const string AlternativeContentSources = "label-alternative-content-sources";
[TranslationReference]
[FluentReference]
const string InstallingContent = "label-installing-content";
[TranslationReference("filename")]
[FluentReference("filename")]
public const string CopyingFilename = "label-copying-filename";
[TranslationReference("filename", "progress")]
[FluentReference("filename", "progress")]
public const string CopyingFilenameProgress = "label-copying-filename-progress";
[TranslationReference]
[FluentReference]
const string InstallationFailed = "label-installation-failed";
[TranslationReference]
[FluentReference]
const string CheckInstallLog = "label-check-install-log";
[TranslationReference("filename")]
[FluentReference("filename")]
public const string Extracing = "label-extracting-filename";
[TranslationReference("filename", "progress")]
[FluentReference("filename", "progress")]
public const string ExtractingProgress = "label-extracting-filename-progress";
[TranslationReference]
[FluentReference]
public const string Continue = "button-continue";
[TranslationReference]
[FluentReference]
const string Cancel = "button-cancel";
[TranslationReference]
[FluentReference]
const string Retry = "button-retry";
[TranslationReference]
[FluentReference]
const string Back = "button-back";
// Hide percentage indicators for files smaller than 25 MB
@@ -160,15 +160,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void DetectContentSources()
{
var message = TranslationProvider.GetString(DetectingSources);
ShowProgressbar(TranslationProvider.GetString(CheckingSources), () => message);
var message = FluentProvider.GetString(DetectingSources);
ShowProgressbar(FluentProvider.GetString(CheckingSources), () => message);
ShowBackRetry(DetectContentSources);
new Task(() =>
{
foreach (var kv in sources)
{
message = TranslationProvider.GetString(SearchingSourceFor, Translation.Arguments("title", kv.Value.Title));
message = FluentProvider.GetString(SearchingSourceFor, FluentBundle.Arguments("title", kv.Value.Title));
var sourceResolver = kv.Value.ObjectCreator.CreateObject<ISourceResolver>($"{kv.Value.Type.Value}SourceResolver");
@@ -188,7 +188,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
Game.RunAfterTick(() =>
{
ShowList(kv.Value, TranslationProvider.GetString(ContentPackageInstallation));
ShowList(kv.Value, FluentProvider.GetString(ContentPackageInstallation));
ShowContinueCancel(() => InstallFromSource(path, kv.Value));
});
@@ -220,14 +220,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var options = new Dictionary<string, IEnumerable<string>>();
if (gameSources.Count != 0)
options.Add(TranslationProvider.GetString(GameSources), gameSources);
options.Add(FluentProvider.GetString(GameSources), gameSources);
if (digitalInstalls.Count != 0)
options.Add(TranslationProvider.GetString(DigitalInstalls), digitalInstalls);
options.Add(FluentProvider.GetString(DigitalInstalls), digitalInstalls);
Game.RunAfterTick(() =>
{
ShowList(TranslationProvider.GetString(GameContentNotFound), TranslationProvider.GetString(AlternativeContentSources), options);
ShowList(FluentProvider.GetString(GameContentNotFound), FluentProvider.GetString(AlternativeContentSources), options);
ShowBackRetry(DetectContentSources);
});
}).Start();
@@ -236,7 +236,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void InstallFromSource(string path, ModContent.ModSource modSource)
{
var message = "";
ShowProgressbar(TranslationProvider.GetString(InstallingContent), () => message);
ShowProgressbar(FluentProvider.GetString(InstallingContent), () => message);
ShowDisabledCancel();
new Task(() =>
@@ -292,7 +292,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Game.RunAfterTick(() =>
{
ShowMessage(TranslationProvider.GetString(InstallationFailed), TranslationProvider.GetString(CheckInstallLog));
ShowMessage(FluentProvider.GetString(InstallationFailed), FluentProvider.GetString(CheckInstallLog));
ShowBackRetry(() => InstallFromSource(path, modSource));
});
}
@@ -398,12 +398,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void ShowContinueCancel(Action continueAction)
{
primaryButton.OnClick = continueAction;
var primaryButtonText = TranslationProvider.GetString(Continue);
var primaryButtonText = FluentProvider.GetString(Continue);
primaryButton.GetText = () => primaryButtonText;
primaryButton.Visible = true;
secondaryButton.OnClick = Ui.CloseWindow;
var secondaryButtonText = TranslationProvider.GetString(Cancel);
var secondaryButtonText = FluentProvider.GetString(Cancel);
secondaryButton.GetText = () => secondaryButtonText;
secondaryButton.Visible = true;
secondaryButton.Disabled = false;
@@ -413,12 +413,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void ShowBackRetry(Action retryAction)
{
primaryButton.OnClick = retryAction;
var primaryButtonText = TranslationProvider.GetString(Retry);
var primaryButtonText = FluentProvider.GetString(Retry);
primaryButton.GetText = () => primaryButtonText;
primaryButton.Visible = true;
secondaryButton.OnClick = Ui.CloseWindow;
var secondaryButtonText = TranslationProvider.GetString(Back);
var secondaryButtonText = FluentProvider.GetString(Back);
secondaryButton.GetText = () => secondaryButtonText;
secondaryButton.Visible = true;
secondaryButton.Disabled = false;