Remove FluentBundle.Arguments helper method.

This commit is contained in:
Paul Chote
2024-10-02 22:40:05 +01:00
committed by Gustas
parent b29b685058
commit d6285affec
71 changed files with 273 additions and 283 deletions

View File

@@ -44,13 +44,12 @@ namespace OpenRA.Mods.Common.Installer
Action<long> onProgress = null;
if (length < InstallFromSourceLogic.ShowPercentageThreshold)
updateMessage(FluentProvider.GetString(
InstallFromSourceLogic.CopyingFilename,
FluentBundle.Arguments("filename", displayFilename)));
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.CopyingFilename,
"filename", displayFilename));
else
onProgress = b => updateMessage(FluentProvider.GetString(
InstallFromSourceLogic.CopyingFilenameProgress,
FluentBundle.Arguments("filename", displayFilename, "progress", 100 * b / length)));
onProgress = b => updateMessage(FluentProvider.GetString(InstallFromSourceLogic.CopyingFilenameProgress,
"filename", displayFilename,
"progress", 100 * b / length));
InstallerUtils.CopyStream(source, target, length, onProgress);
}

View File

@@ -68,13 +68,12 @@ namespace OpenRA.Mods.Common.Installer
Action<long> onProgress = null;
if (length < InstallFromSourceLogic.ShowPercentageThreshold)
updateMessage(FluentProvider.GetString(
InstallFromSourceLogic.Extracing,
FluentBundle.Arguments("filename", displayFilename)));
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.Extracting,
"filename", displayFilename));
else
onProgress = b => updateMessage(FluentProvider.GetString(
InstallFromSourceLogic.ExtractingProgress,
FluentBundle.Arguments("filename", displayFilename, "progress", 100 * b / length)));
onProgress = b => updateMessage(FluentProvider.GetString(InstallFromSourceLogic.ExtractingProgress,
"filename", displayFilename,
"progress", 100 * b / length));
using (var target = File.OpenWrite(targetPath))
{

View File

@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Installer
var displayFilename = Path.GetFileName(Path.GetFileName(targetPath));
void OnProgress(int percent) => updateMessage(FluentProvider.GetString(
InstallFromSourceLogic.ExtractingProgress,
FluentBundle.Arguments("filename", displayFilename, "progress", percent)));
"filename", displayFilename, "progress", percent));
reader.ExtractFile(node.Value.Value, target, OnProgress);
}
}

View File

@@ -46,9 +46,9 @@ namespace OpenRA.Mods.Common.Installer
{
Log.Write("install", $"Extracting {sourcePath} -> {targetPath}");
var displayFilename = Path.GetFileName(Path.GetFileName(targetPath));
void OnProgress(int percent) => updateMessage(FluentProvider.GetString(
InstallFromSourceLogic.ExtractingProgress,
FluentBundle.Arguments("filename", displayFilename, "progress", percent)));
void OnProgress(int percent) => updateMessage(FluentProvider.GetString(InstallFromSourceLogic.ExtractingProgress,
"filename", displayFilename,
"progress", percent));
reader.ExtractFile(node.Value.Value, target, OnProgress);
}
}

View File

@@ -61,11 +61,12 @@ namespace OpenRA.Mods.Common.Installer
Action<long> onProgress = null;
if (length < InstallFromSourceLogic.ShowPercentageThreshold)
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.Extracing, FluentBundle.Arguments("filename", displayFilename)));
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.Extracting,
"filename", displayFilename));
else
onProgress = b => updateMessage(FluentProvider.GetString(
InstallFromSourceLogic.ExtractingProgress,
FluentBundle.Arguments("filename", displayFilename, "progress", 100 * b / length)));
onProgress = b => updateMessage(FluentProvider.GetString(InstallFromSourceLogic.ExtractingProgress,
"filename", displayFilename,
"progress", 100 * b / length));
using (var target = File.OpenWrite(targetPath))
{

View File

@@ -49,9 +49,9 @@ namespace OpenRA.Mods.Common.Installer
using (var targetStream = File.OpenWrite(targetPath))
sourceStream.CopyTo(targetStream);
updateMessage(FluentProvider.GetString(
InstallFromSourceLogic.ExtractingProgress,
FluentBundle.Arguments("filename", displayFilename, "progress", 100)));
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.ExtractingProgress,
"filename", displayFilename,
"progress", 100));
extracted.Add(targetPath);
}