Skip to content

Commit

Permalink
Fix CA1305
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbr committed Apr 4, 2024
1 parent 5329f20 commit 2099c58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Launcher/Launcher/src/Commands/Install.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.CommandLine;
using System.Globalization;

using Launcher.Helpers;
using Launcher.i18n;
Expand All @@ -8,7 +9,7 @@ namespace Launcher.Commands;
public static class Install {
public static Command GetCommand() {
var command = new Command("install") {
Description = string.Format(Translations.Install_Description, DistributionInfo.DisplayName)
Description = string.Format(CultureInfo.CurrentCulture, Translations.Install_Description, DistributionInfo.DisplayName)
};
var reinstallOpt = new Option<bool>("--reinstall") {
Description = Translations.Install_OptionReinstall
Expand Down
3 changes: 2 additions & 1 deletion Launcher/Launcher/src/Commands/Uninstall.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.CommandLine;
using System.Globalization;

using Launcher.Helpers;
using Launcher.i18n;
Expand All @@ -8,7 +9,7 @@ namespace Launcher.Commands;
public static class Uninstall {
public static Command GetCommand() {
var command = new Command("uninstall") {
Description = string.Format(Translations.Install_UninstallDescription, DistributionInfo.DisplayName)
Description = string.Format(CultureInfo.CurrentCulture, Translations.Install_UninstallDescription, DistributionInfo.DisplayName)
};

command.SetHandler(() => { Program.Result = InstallationHelper.Uninstall() ? 0 : 1; });
Expand Down
7 changes: 4 additions & 3 deletions Launcher/Launcher/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.CommandLine.IO;
using System.CommandLine.Parsing;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;

using Windows.Win32.Foundation;

Expand All @@ -25,7 +26,7 @@ internal static class Program {
// Argparse docs: https://github.com/dotnet/command-line-api

var rootCommand = new RootCommand(
string.Format(Translations.Root_Description, DistributionInfo.DisplayName)
string.Format(CultureInfo.CurrentCulture, Translations.Root_Description, DistributionInfo.DisplayName)
) {
Run.GetCommand(),
Install.GetCommand(),
Expand Down Expand Up @@ -97,8 +98,8 @@ internal static class Program {
var vl = VersionHelper.LauncherVersion?.ToString();
var vi = VersionHelper.InstalledVersion?.ToString() ?? "UNKNOWN";
context.Console.Out.WriteLine(string.Format(Translations.Version_Launcher, vl));
context.Console.Out.WriteLine(string.Format(Translations.Version_Module, vi));
context.Console.Out.WriteLine(string.Format(CultureInfo.CurrentCulture, Translations.Version_Launcher, vl));
context.Console.Out.WriteLine(string.Format(CultureInfo.CurrentCulture, Translations.Version_Module, vi));
} else {
await next(context).ConfigureAwait(false);
}
Expand Down

0 comments on commit 2099c58

Please sign in to comment.