From ad27eade569ba0465a69f7830559a98c7d1f2630 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sat, 8 Apr 2017 21:12:44 +0200 Subject: [PATCH] Further enhance remaining TimeSpan-based strings --- ArchiSteamFarm/ASF.cs | 8 +++++--- ArchiSteamFarm/Bot.cs | 4 ++-- ArchiSteamFarm/Localization/Strings.Designer.cs | 6 +++--- ArchiSteamFarm/Localization/Strings.resx | 12 ++++++------ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ArchiSteamFarm/ASF.cs b/ArchiSteamFarm/ASF.cs index 35e330ccc..61fe12ccd 100644 --- a/ArchiSteamFarm/ASF.cs +++ b/ArchiSteamFarm/ASF.cs @@ -75,14 +75,16 @@ namespace ArchiSteamFarm { } if ((AutoUpdatesTimer == null) && Program.GlobalConfig.AutoUpdates) { + TimeSpan autoUpdatePeriod = TimeSpan.FromHours(AutoUpdatePeriodInHours); + AutoUpdatesTimer = new Timer( async e => await CheckForUpdate().ConfigureAwait(false), null, - TimeSpan.FromHours(AutoUpdatePeriodInHours), // Delay - TimeSpan.FromHours(AutoUpdatePeriodInHours) // Period + autoUpdatePeriod, // Delay + autoUpdatePeriod // Period ); - ArchiLogger.LogGenericInfo(string.Format(Strings.AutoUpdateCheckInfo, AutoUpdatePeriodInHours)); + ArchiLogger.LogGenericInfo(string.Format(Strings.AutoUpdateCheckInfo, autoUpdatePeriod.ToHumanReadable())); } string releaseURL = SharedInfo.GithubReleaseURL; diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 04a36057a..f731693e4 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -1415,7 +1415,7 @@ namespace ArchiSteamFarm { await Task.Delay(5000).ConfigureAwait(false); break; case EResult.RateLimitExceeded: - ArchiLogger.LogGenericInfo(string.Format(Strings.BotRateLimitExceeded, LoginCooldownInMinutes)); + ArchiLogger.LogGenericInfo(string.Format(Strings.BotRateLimitExceeded, TimeSpan.FromMinutes(LoginCooldownInMinutes).ToHumanReadable())); await Task.Delay(LoginCooldownInMinutes * 60 * 1000).ConfigureAwait(false); break; case EResult.AccountDisabled: @@ -2764,7 +2764,7 @@ namespace ArchiSteamFarm { } StartFamilySharingInactivityTimer(); - return FormatBotResponse(string.Format(Strings.BotAutomaticIdlingPausedWithCountdown, FamilySharingInactivityMinutes)); + return FormatBotResponse(string.Format(Strings.BotAutomaticIdlingPausedWithCountdown, TimeSpan.FromMinutes(FamilySharingInactivityMinutes).ToHumanReadable())); } private static async Task ResponsePause(ulong steamID, string botNames, bool sticky) { diff --git a/ArchiSteamFarm/Localization/Strings.Designer.cs b/ArchiSteamFarm/Localization/Strings.Designer.cs index 8cbbc851e..fd7d6cd7c 100644 --- a/ArchiSteamFarm/Localization/Strings.Designer.cs +++ b/ArchiSteamFarm/Localization/Strings.Designer.cs @@ -70,7 +70,7 @@ namespace ArchiSteamFarm.Localization { } /// - /// Wyszukuje zlokalizowany ciąg podobny do ciągu ASF will automatically check for new versions every {0} hours.. + /// Wyszukuje zlokalizowany ciąg podobny do ciągu ASF will automatically check for new versions every {0}.. /// internal static string AutoUpdateCheckInfo { get { @@ -223,7 +223,7 @@ namespace ArchiSteamFarm.Localization { } /// - /// Wyszukuje zlokalizowany ciąg podobny do ciągu Automatic idling is now paused! You have {0} minutes to start a game.. + /// Wyszukuje zlokalizowany ciąg podobny do ciągu Automatic idling is now paused! You have {0} to start a game.. /// internal static string BotAutomaticIdlingPausedWithCountdown { get { @@ -493,7 +493,7 @@ namespace ArchiSteamFarm.Localization { } /// - /// Wyszukuje zlokalizowany ciąg podobny do ciągu Rate limit exceeded; we will retry after {0} minutes of cooldown.... + /// Wyszukuje zlokalizowany ciąg podobny do ciągu Rate limit exceeded; we will retry after {0} of cooldown.... /// internal static string BotRateLimitExceeded { get { diff --git a/ArchiSteamFarm/Localization/Strings.resx b/ArchiSteamFarm/Localization/Strings.resx index f652aec94..0018b4828 100644 --- a/ArchiSteamFarm/Localization/Strings.resx +++ b/ArchiSteamFarm/Localization/Strings.resx @@ -122,8 +122,8 @@ {0} will be replaced by trade number - ASF will automatically check for new versions every {0} hours. - {0} will be replaced by number of hours + ASF will automatically check for new versions every {0}. + {0} will be replaced by translated TimeSpan string (such as "24 hours") Content: @@ -478,8 +478,8 @@ StackTrace: Automatic idling is paused already! - Automatic idling is now paused! You have {0} minutes to start a game. - {0} will be replaced by number of minutes + Automatic idling is now paused! You have {0} to start a game. + {0} will be replaced by translated TimeSpan string (such as "5 minutes") Automatic idling is resumed already! @@ -556,8 +556,8 @@ StackTrace: {0} will be replaced by game's ID (number), {1} will be replaced by game's name - Rate limit exceeded; we will retry after {0} minutes of cooldown... - {0} will be replaced by number of minutes + Rate limit exceeded; we will retry after {0} of cooldown... + {0} will be replaced by translated TimeSpan string (such as "25 minutes") Reconnecting...