From 8614ef63769d6e9011b0dbd00ee6f15c0033ad11 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Fri, 6 Jan 2017 18:02:45 +0100 Subject: [PATCH] Localizing... --- ArchiSteamFarm/Bot.cs | 221 ++++++--------- .../Localization/Strings.Designer.cs | 261 ++++++++++++++++++ ArchiSteamFarm/Localization/Strings.resx | 107 +++++++ 3 files changed, 450 insertions(+), 139 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 476c8afd4..6dd99c955 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -118,7 +118,7 @@ namespace ArchiSteamFarm { } if (Bots.ContainsKey(botName)) { - throw new ArgumentException("That bot is already defined!"); + throw new ArgumentException(string.Format(Strings.ErrorIsInvalid, nameof(botName))); } BotName = botName; @@ -320,7 +320,7 @@ namespace ArchiSteamFarm { try { await SteamDirectory.Initialize(cellID).ConfigureAwait(false); - Program.ArchiLogger.LogGenericInfo("Done!"); + Program.ArchiLogger.LogGenericInfo(Strings.Success); } catch { Program.ArchiLogger.LogGenericWarning("Could not initialize SteamDirectory, connecting with Steam Network might take much longer than usual!"); } @@ -1534,11 +1534,7 @@ namespace ArchiSteamFarm { return await bot.Response2FA(steamID).ConfigureAwait(false); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private async Task Response2FAConfirm(ulong steamID, bool confirm) { @@ -1552,7 +1548,7 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - return "This bot instance is not connected!"; + return Strings.BotNotConnected; } if (!HasMobileAuthenticator) { @@ -1577,11 +1573,7 @@ namespace ArchiSteamFarm { return await bot.Response2FAConfirm(steamID, confirm).ConfigureAwait(false); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private async Task ResponseAddLicense(ulong steamID, ICollection gameIDs) { @@ -1595,7 +1587,7 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - return "This bot instance is not connected!"; + return Strings.BotNotConnected; } StringBuilder result = new StringBuilder(); @@ -1626,11 +1618,7 @@ namespace ArchiSteamFarm { Bot bot; if (!Bots.TryGetValue(botName, out bot)) { - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } string[] gameIDs = games.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); @@ -1677,7 +1665,7 @@ namespace ArchiSteamFarm { Program.Exit(); }).Forget(); - return "Done!"; + return Strings.Done; } private async Task ResponseFarm(ulong steamID) { @@ -1691,12 +1679,12 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - return "This bot instance is not connected!"; + return Strings.BotNotConnected; } await CardsFarmer.StopFarming().ConfigureAwait(false); CardsFarmer.StartFarming().Forget(); - return "Done!"; + return Strings.Done; } private static async Task ResponseFarm(ulong steamID, string botName) { @@ -1710,11 +1698,7 @@ namespace ArchiSteamFarm { return await bot.ResponseFarm(steamID).ConfigureAwait(false); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private string ResponseHelp(ulong steamID) { @@ -1741,7 +1725,7 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - return "This bot instance is not connected!"; + return Strings.BotNotConnected; } if (!LootingAllowed) { @@ -1787,11 +1771,7 @@ namespace ArchiSteamFarm { return await bot.ResponseLoot(steamID).ConfigureAwait(false); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private static async Task ResponseLootAll(ulong steamID) { @@ -1805,7 +1785,7 @@ namespace ArchiSteamFarm { } await Task.WhenAll(Bots.Values.Where(bot => bot.IsConnectedAndLoggedOn).Select(bot => bot.ResponseLoot(steamID))).ConfigureAwait(false); - return "Done!"; + return Strings.Done; } private string ResponseLootSwitch(ulong steamID) { @@ -1819,7 +1799,7 @@ namespace ArchiSteamFarm { } LootingAllowed = !LootingAllowed; - return "Looting is now " + (LootingAllowed ? "enabled" : "disabled") + "!"; + return LootingAllowed ? Strings.BotLootingEnabled : Strings.BotLootingDisabled; } private static string ResponseLootSwitch(ulong steamID, string botName) { @@ -1833,11 +1813,7 @@ namespace ArchiSteamFarm { return bot.ResponseLootSwitch(steamID); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private async Task ResponseOwns(ulong steamID, string query) { @@ -1851,7 +1827,7 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - return "This bot instance is not connected!"; + return Strings.BotNotConnected; } Dictionary ownedGames; @@ -1862,7 +1838,7 @@ namespace ArchiSteamFarm { } if ((ownedGames == null) || (ownedGames.Count == 0)) { - return Environment.NewLine + "<" + BotName + "> List of owned games is empty!"; + return Environment.NewLine + string.Format(Strings.ErrorIsEmpty, nameof(ownedGames)); } StringBuilder response = new StringBuilder(); @@ -1874,9 +1850,9 @@ namespace ArchiSteamFarm { if (uint.TryParse(game, out appID)) { string ownedName; if (ownedGames.TryGetValue(appID, out ownedName)) { - response.Append(Environment.NewLine + "<" + BotName + "> Owned already: " + appID + " | " + ownedName); + response.Append(Environment.NewLine + string.Format(Strings.BotOwnedAlready, BotName, appID, ownedName)); } else { - response.Append(Environment.NewLine + "<" + BotName + "> Not owned yet: " + appID); + response.Append(Environment.NewLine + string.Format(Strings.BotNotOwnedYet, BotName, appID)); } continue; @@ -1884,7 +1860,7 @@ namespace ArchiSteamFarm { // This is a string, so check our entire library foreach (KeyValuePair ownedGame in ownedGames.Where(ownedGame => ownedGame.Value.IndexOf(game, StringComparison.OrdinalIgnoreCase) >= 0)) { - response.Append(Environment.NewLine + "<" + BotName + "> Owned already: " + ownedGame.Key + " | " + ownedGame.Value); + response.Append(Environment.NewLine + string.Format(Strings.BotOwnedAlready, BotName, ownedGame.Key, ownedGame.Value)); } } @@ -1892,7 +1868,7 @@ namespace ArchiSteamFarm { return response.ToString(); } - return Environment.NewLine + "<" + BotName + "> Not owned yet: " + query; + return Environment.NewLine + string.Format(Strings.BotNotOwnedYet, BotName, query); } private static async Task ResponseOwns(ulong steamID, string botName, string query) { @@ -1906,11 +1882,7 @@ namespace ArchiSteamFarm { return await bot.ResponseOwns(steamID, query).ConfigureAwait(false); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private static async Task ResponseOwnsAll(ulong steamID, string query) { @@ -1930,7 +1902,7 @@ namespace ArchiSteamFarm { result.Append(response); } - return result.Length != 0 ? result.ToString() : null; + return result.Length > 0 ? result.ToString() : null; } private string ResponsePassword(ulong steamID) { @@ -1944,10 +1916,10 @@ namespace ArchiSteamFarm { } if (string.IsNullOrEmpty(BotConfig.SteamPassword)) { - return "Can't encrypt null password!"; + return string.Join(Strings.ErrorIsEmpty, nameof(BotConfig.SteamPassword)); } - return Environment.NewLine + "[" + CryptoHelper.ECryptoMethod.AES + "] password: " + CryptoHelper.Encrypt(CryptoHelper.ECryptoMethod.AES, BotConfig.SteamPassword) + Environment.NewLine + "[" + CryptoHelper.ECryptoMethod.ProtectedDataForCurrentUser + "] password: " + CryptoHelper.Encrypt(CryptoHelper.ECryptoMethod.ProtectedDataForCurrentUser, BotConfig.SteamPassword); + return Environment.NewLine + string.Format(Strings.BotEncryptedPassword, CryptoHelper.ECryptoMethod.AES, CryptoHelper.Encrypt(CryptoHelper.ECryptoMethod.AES, BotConfig.SteamPassword)) + Environment.NewLine + string.Format(Strings.BotEncryptedPassword, CryptoHelper.ECryptoMethod.ProtectedDataForCurrentUser, CryptoHelper.Encrypt(CryptoHelper.ECryptoMethod.ProtectedDataForCurrentUser, BotConfig.SteamPassword)); } private static string ResponsePassword(ulong steamID, string botName) { @@ -1961,11 +1933,7 @@ namespace ArchiSteamFarm { return bot.ResponsePassword(steamID); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private async Task ResponsePause(ulong steamID, bool sticky) { @@ -1979,21 +1947,21 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - return "This bot instance is not connected!"; + return Strings.BotNotConnected; } if (CardsFarmer.Paused) { - return "Automatic farming is paused already!"; + return Strings.BotAutomaticIdlingPausedAlready; } await CardsFarmer.Pause(sticky).ConfigureAwait(false); if (!SteamFamilySharingIDs.Contains(steamID)) { - return "Automatic farming is now paused!"; + return Strings.BotAutomaticIdlingPaused; } StartFamilySharingInactivityTimer(); - return "Automatic farming is now paused! You have " + FamilySharingInactivityMinutes + " minutes to start a game."; + return string.Join(Strings.BotAutomaticIdlingPausedWithCountdown, FamilySharingInactivityMinutes); } private static async Task ResponsePause(ulong steamID, string botName, bool sticky) { @@ -2007,11 +1975,7 @@ namespace ArchiSteamFarm { return await bot.ResponsePause(steamID, sticky).ConfigureAwait(false); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private async Task ResponsePlay(ulong steamID, HashSet gameIDs) { @@ -2025,7 +1989,7 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - return "This bot instance is not connected!"; + return Strings.BotNotConnected; } if (!CardsFarmer.Paused) { @@ -2033,7 +1997,7 @@ namespace ArchiSteamFarm { } ArchiHandler.PlayGames(gameIDs); - return "Done!"; + return Strings.Done; } private static async Task ResponsePlay(ulong steamID, string botName, string games) { @@ -2044,11 +2008,7 @@ namespace ArchiSteamFarm { Bot bot; if (!Bots.TryGetValue(botName, out bot)) { - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } string[] gameIDs = games.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); @@ -2057,7 +2017,7 @@ namespace ArchiSteamFarm { foreach (string game in gameIDs.Where(game => !string.IsNullOrEmpty(game))) { uint gameID; if (!uint.TryParse(game, out gameID)) { - return "Couldn't parse games list!"; + return string.Format(Strings.ErrorParsingObject, nameof(gameID)); } gamesToPlay.Add(gameID); @@ -2068,7 +2028,7 @@ namespace ArchiSteamFarm { } if (gamesToPlay.Count == 0) { - return "List of games is empty!"; + return string.Format(Strings.ErrorIsEmpty, gamesToPlay); } return await bot.ResponsePlay(steamID, gamesToPlay).ConfigureAwait(false); @@ -2086,7 +2046,7 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - return "This bot instance is not connected!"; + return Strings.BotNotConnected; } bool forward = !redeemFlags.HasFlag(ERedeemFlags.SkipForwarding) && (redeemFlags.HasFlag(ERedeemFlags.ForceForwarding) || BotConfig.RedeemingPreferences.HasFlag(BotConfig.ERedeemingPreferences.Forwarding)); @@ -2129,7 +2089,11 @@ namespace ArchiSteamFarm { result.PurchaseResult = await currentBot.ArchiWebHandler.RedeemWalletKey(key).ConfigureAwait(false); } - response.Append(Environment.NewLine + "<" + currentBot.BotName + "> Key: " + key + " | Status: " + result.PurchaseResult + ((result.Items != null) && (result.Items.Count > 0) ? " | Items: " + string.Join("", result.Items) : "")); + if ((result.Items != null) && (result.Items.Count > 0)) { + response.Append(Environment.NewLine + string.Join(Strings.BotRedeemResponseWithItems, currentBot.BotName, key, result.PurchaseResult, result.Items)); + } else { + response.Append(Environment.NewLine + string.Join(Strings.BotRedeemResponse, currentBot.BotName, key, result.PurchaseResult)); + } if (result.PurchaseResult == ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OK) { unusedKeys.Remove(key); @@ -2146,7 +2110,11 @@ namespace ArchiSteamFarm { case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.BaseGameRequired: case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OnCooldown: case ArchiHandler.PurchaseResponseCallback.EPurchaseResult.RegionLocked: - response.Append(Environment.NewLine + "<" + currentBot.BotName + "> Key: " + key + " | Status: " + result.PurchaseResult + ((result.Items != null) && (result.Items.Count > 0) ? " | Items: " + string.Join("", result.Items) : "")); + if ((result.Items != null) && (result.Items.Count > 0)) { + response.Append(Environment.NewLine + string.Join(Strings.BotRedeemResponseWithItems, currentBot.BotName, key, result.PurchaseResult, result.Items)); + } else { + response.Append(Environment.NewLine + string.Join(Strings.BotRedeemResponse, currentBot.BotName, key, result.PurchaseResult)); + } if (!forward) { key = reader.ReadLine(); // Next key @@ -2164,7 +2132,7 @@ namespace ArchiSteamFarm { foreach (Bot bot in Bots.Where(bot => (bot.Value != previousBot) && (!redeemFlags.HasFlag(ERedeemFlags.SkipInitial) || (bot.Value != this)) && bot.Value.IsConnectedAndLoggedOn && ((items.Count == 0) || items.Keys.Any(packageID => !bot.Value.OwnedPackageIDs.Contains(packageID)))).OrderBy(bot => bot.Key).Select(bot => bot.Value)) { ArchiHandler.PurchaseResponseCallback otherResult = await bot.ArchiHandler.RedeemKey(key).ConfigureAwait(false); if (otherResult == null) { - response.Append(Environment.NewLine + "<" + bot.BotName + "> Key: " + key + " | Status: Timeout!"); + response.Append(Environment.NewLine + string.Join(Strings.BotRedeemResponse, bot.BotName, key, "Timeout!")); continue; } @@ -2181,7 +2149,11 @@ namespace ArchiSteamFarm { break; } - response.Append(Environment.NewLine + "<" + bot.BotName + "> Key: " + key + " | Status: " + otherResult.PurchaseResult + ((otherResult.Items != null) && (otherResult.Items.Count > 0) ? " | Items: " + string.Join("", otherResult.Items) : "")); + if ((otherResult.Items != null) && (otherResult.Items.Count > 0)) { + response.Append(Environment.NewLine + string.Join(Strings.BotRedeemResponseWithItems, bot.BotName, key, otherResult.PurchaseResult, otherResult.Items)); + } else { + response.Append(Environment.NewLine + string.Join(Strings.BotRedeemResponse, bot.BotName, key, otherResult.PurchaseResult)); + } if (alreadyHandled) { break; @@ -2214,7 +2186,7 @@ namespace ArchiSteamFarm { } if (unusedKeys.Count > 0) { - response.Append(Environment.NewLine + "Unused keys: " + string.Join(", ", unusedKeys)); + response.Append(Environment.NewLine + string.Format(Strings.UnusedKeys, string.Join(", ", unusedKeys))); } return response.Length > 0 ? response.ToString() : null; @@ -2231,11 +2203,7 @@ namespace ArchiSteamFarm { return await bot.ResponseRedeem(steamID, message, redeemFlags).ConfigureAwait(false); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private static string ResponseRejoinChat(ulong steamID) { @@ -2252,7 +2220,7 @@ namespace ArchiSteamFarm { bot.JoinMasterChat(); } - return "Done!"; + return Strings.Done; } private static string ResponseRestart(ulong steamID) { @@ -2271,7 +2239,7 @@ namespace ArchiSteamFarm { Program.Restart(); }).Forget(); - return "Done!"; + return Strings.Done; } private string ResponseResume(ulong steamID) { @@ -2285,16 +2253,16 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - return "This bot instance is not connected!"; + return Strings.BotNotConnected; } if (!CardsFarmer.Paused) { - return "Automatic farming is resumed already!"; + return Strings.BotAutomaticIdlingResumedAlready; } StopFamilySharingInactivityTimer(); CardsFarmer.Resume(true); - return "Automatic farming is now resumed!"; + return Strings.BotAutomaticIdlingResumed; } private static string ResponseResume(ulong steamID, string botName) { @@ -2308,11 +2276,7 @@ namespace ArchiSteamFarm { return bot.ResponseResume(steamID); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private string ResponseStart(ulong steamID) { @@ -2326,12 +2290,12 @@ namespace ArchiSteamFarm { } if (KeepRunning) { - return "That bot instance is already running!"; + return Strings.BotAlreadyRunning; } SkipFirstShutdown = true; Start().Forget(); - return "Done!"; + return Strings.Done; } private static string ResponseStart(ulong steamID, string botName) { @@ -2345,11 +2309,7 @@ namespace ArchiSteamFarm { return bot.ResponseStart(steamID); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private static string ResponseStartAll(ulong steamID) { @@ -2366,7 +2326,7 @@ namespace ArchiSteamFarm { bot.ResponseStart(steamID); } - return "Done!"; + return Strings.Done; } private string ResponseStatus(ulong steamID) { @@ -2380,40 +2340,31 @@ namespace ArchiSteamFarm { } if (!IsConnectedAndLoggedOn) { - if (KeepRunning) { - return "Bot " + BotName + " is not connected."; - } - - return "Bot " + BotName + " is not running."; + return string.Format(KeepRunning ? Strings.BotStatusNotConnected : Strings.BotStatusNotRunning, BotName); } if (PlayingBlocked) { - return "Bot " + BotName + " is currently being used."; + return string.Format(Strings.BotStatusPlayingNotAvailable, BotName); } if (CardsFarmer.Paused) { - return "Bot " + BotName + " is paused or running in manual mode."; + return string.Format(Strings.BotStatusPaused, BotName); } if (IsLimitedUser) { - return "Bot " + BotName + " is limited."; + return string.Format(Strings.BotStatusLimited, BotName); } if (CardsFarmer.CurrentGamesFarming.Count == 0) { - return "Bot " + BotName + " is not farming anything."; + return string.Format(Strings.BotsStatusNotIdling, BotName); } - StringBuilder response = new StringBuilder("Bot " + BotName + " is idling "); - - if (CardsFarmer.CurrentGamesFarming.Count == 1) { - CardsFarmer.Game game = CardsFarmer.CurrentGamesFarming.First(); - response.Append("game: " + game.AppID + " (" + game.GameName + ", " + game.CardsRemaining + " card drops remaining)"); - } else { - response.Append("appIDs: " + string.Join(", ", CardsFarmer.CurrentGamesFarming.Select(game => game.AppID))); + if (CardsFarmer.CurrentGamesFarming.Count > 1) { + return string.Format(Strings.BotStatusIdling, BotName, CardsFarmer.GamesToFarm.Count, CardsFarmer.GamesToFarm.Sum(game => game.CardsRemaining), CardsFarmer.TimeRemaining.ToHumanReadable()); } - response.Append(" from a total of " + CardsFarmer.GamesToFarm.Count + " games (" + CardsFarmer.GamesToFarm.Sum(game => game.CardsRemaining) + " cards) left to idle (~" + CardsFarmer.TimeRemaining.ToHumanReadable() + " remaining)."); - return response.ToString(); + CardsFarmer.Game soloGame = CardsFarmer.CurrentGamesFarming.First(); + return string.Format(Strings.BotStatusIdling, BotName, soloGame.AppID, soloGame.GameName, soloGame.CardsRemaining, CardsFarmer.GamesToFarm.Count, CardsFarmer.GamesToFarm.Sum(game => game.CardsRemaining), CardsFarmer.TimeRemaining.ToHumanReadable()); } private static string ResponseStatus(ulong steamID, string botName) { @@ -2427,11 +2378,7 @@ namespace ArchiSteamFarm { return bot.ResponseStatus(steamID); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private static string ResponseStatusAll(ulong steamID) { @@ -2447,7 +2394,7 @@ namespace ArchiSteamFarm { HashSet botsRunning = new HashSet(Bots.Where(bot => bot.Value.KeepRunning).OrderBy(bot => bot.Key).Select(bot => bot.Value)); IEnumerable statuses = botsRunning.Select(bot => bot.ResponseStatus(steamID)); - return Environment.NewLine + string.Join(Environment.NewLine, statuses) + Environment.NewLine + "There are " + botsRunning.Count + "/" + Bots.Count + " bots running, with total of " + botsRunning.Sum(bot => bot.CardsFarmer.GamesToFarm.Count) + " games (" + botsRunning.Sum(bot => bot.CardsFarmer.GamesToFarm.Sum(game => game.CardsRemaining)) + " cards) left to farm."; + return Environment.NewLine + string.Join(Environment.NewLine, statuses) + Environment.NewLine + string.Format(Strings.BotsStatusOverview, botsRunning.Count, Bots.Count, botsRunning.Sum(bot => bot.CardsFarmer.GamesToFarm.Count), botsRunning.Sum(bot => bot.CardsFarmer.GamesToFarm.Sum(game => game.CardsRemaining))); } private string ResponseStop(ulong steamID) { @@ -2461,11 +2408,11 @@ namespace ArchiSteamFarm { } if (!KeepRunning) { - return "That bot instance is already inactive!"; + return Strings.BotAlreadyStopped; } Stop(); - return "Done!"; + return Strings.Done; } private static string ResponseStop(ulong steamID, string botName) { @@ -2479,16 +2426,12 @@ namespace ArchiSteamFarm { return bot.ResponseStop(steamID); } - if (IsOwner(steamID)) { - return "Couldn't find any bot named " + botName + "!"; - } - - return null; + return IsOwner(steamID) ? string.Format(Strings.BotNotFound, botName) : null; } private string ResponseUnknown(ulong steamID) { if (steamID != 0) { - return !IsMaster(steamID) ? null : "ERROR: Unknown command!"; + return IsMaster(steamID) ? Strings.UnknownCommand : null; } ArchiLogger.LogNullError(nameof(steamID)); @@ -2506,7 +2449,7 @@ namespace ArchiSteamFarm { } await ASF.CheckForUpdate(true).ConfigureAwait(false); - return "Done!"; + return Strings.Done; } private string ResponseVersion(ulong steamID) { diff --git a/ArchiSteamFarm/Localization/Strings.Designer.cs b/ArchiSteamFarm/Localization/Strings.Designer.cs index 7c78b8720..1c6dd0702 100644 --- a/ArchiSteamFarm/Localization/Strings.Designer.cs +++ b/ArchiSteamFarm/Localization/Strings.Designer.cs @@ -78,6 +78,231 @@ namespace ArchiSteamFarm.Localization { } } + /// + /// Looks up a localized string similar to That bot instance is already running!. + /// + internal static string BotAlreadyRunning { + get { + return ResourceManager.GetString("BotAlreadyRunning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to That bot instance is already stopped!. + /// + internal static string BotAlreadyStopped { + get { + return ResourceManager.GetString("BotAlreadyStopped", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatic idling is now paused!. + /// + internal static string BotAutomaticIdlingPaused { + get { + return ResourceManager.GetString("BotAutomaticIdlingPaused", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatic idling is paused already!. + /// + internal static string BotAutomaticIdlingPausedAlready { + get { + return ResourceManager.GetString("BotAutomaticIdlingPausedAlready", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatic idling is now paused! You have {0} minutes to start a game.. + /// + internal static string BotAutomaticIdlingPausedWithCountdown { + get { + return ResourceManager.GetString("BotAutomaticIdlingPausedWithCountdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatic idling is now resumed!. + /// + internal static string BotAutomaticIdlingResumed { + get { + return ResourceManager.GetString("BotAutomaticIdlingResumed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatic idling is resumed already!. + /// + internal static string BotAutomaticIdlingResumedAlready { + get { + return ResourceManager.GetString("BotAutomaticIdlingResumedAlready", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [{0}] password: {1}. + /// + internal static string BotEncryptedPassword { + get { + return ResourceManager.GetString("BotEncryptedPassword", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looting is now disabled!. + /// + internal static string BotLootingDisabled { + get { + return ResourceManager.GetString("BotLootingDisabled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looting is now enabled!. + /// + internal static string BotLootingEnabled { + get { + return ResourceManager.GetString("BotLootingEnabled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This bot instance is not connected!. + /// + internal static string BotNotConnected { + get { + return ResourceManager.GetString("BotNotConnected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Couldn't find any bot named {0}!. + /// + internal static string BotNotFound { + get { + return ResourceManager.GetString("BotNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <{0}> Not owned yet: {1}. + /// + internal static string BotNotOwnedYet { + get { + return ResourceManager.GetString("BotNotOwnedYet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <{0}> Owned already: {1} | {2}. + /// + internal static string BotOwnedAlready { + get { + return ResourceManager.GetString("BotOwnedAlready", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <{0}> Key: {1} | Status: {2}. + /// + internal static string BotRedeemResponse { + get { + return ResourceManager.GetString("BotRedeemResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <{0}> Key: {1} | Status: {2} | Items: {3}. + /// + internal static string BotRedeemResponseWithItems { + get { + return ResourceManager.GetString("BotRedeemResponseWithItems", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bot {0} is not idling anything.. + /// + internal static string BotsStatusNotIdling { + get { + return ResourceManager.GetString("BotsStatusNotIdling", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are {0}/{1} bots running, with total of {2} games ({3} cards) left to idle.. + /// + internal static string BotsStatusOverview { + get { + return ResourceManager.GetString("BotsStatusOverview", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bot {0} is idling game: {1} ({2}, {3} card drops remaining) from a total of {4} games ({5} cards) left to idle (~{6} remaining).. + /// + internal static string BotStatusIdling { + get { + return ResourceManager.GetString("BotStatusIdling", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bot {0} is idling games: {1} from a total of {2} games ({3} cards) left to idle (~{4} remaining).. + /// + internal static string BotStatusIdlingList { + get { + return ResourceManager.GetString("BotStatusIdlingList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bot {0} is limited and can't drop any cards through idling.. + /// + internal static string BotStatusLimited { + get { + return ResourceManager.GetString("BotStatusLimited", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bot {0} is not connected.. + /// + internal static string BotStatusNotConnected { + get { + return ResourceManager.GetString("BotStatusNotConnected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bot {0} is not running.. + /// + internal static string BotStatusNotRunning { + get { + return ResourceManager.GetString("BotStatusNotRunning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bot {0} is paused or running in manual mode.. + /// + internal static string BotStatusPaused { + get { + return ResourceManager.GetString("BotStatusPaused", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bot {0} is currently being used.. + /// + internal static string BotStatusPlayingNotAvailable { + get { + return ResourceManager.GetString("BotStatusPlayingNotAvailable", resourceCulture); + } + } + /// /// Looks up a localized string similar to Checking first badge page.... /// @@ -115,6 +340,15 @@ namespace ArchiSteamFarm.Localization { } } + /// + /// Looks up a localized string similar to Done!. + /// + internal static string Done { + get { + return ResourceManager.GetString("Done", resourceCulture); + } + } + /// /// Looks up a localized string similar to Configured {0} property is invalid: {1}. /// @@ -189,6 +423,15 @@ namespace ArchiSteamFarm.Localization { } } + /// + /// Looks up a localized string similar to {0} is empty!. + /// + internal static string ErrorIsEmpty { + get { + return ResourceManager.GetString("ErrorIsEmpty", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} is invalid!. /// @@ -630,6 +873,15 @@ namespace ArchiSteamFarm.Localization { } } + /// + /// Looks up a localized string similar to Unknown command!. + /// + internal static string UnknownCommand { + get { + return ResourceManager.GetString("UnknownCommand", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unlocking parental account.... /// @@ -639,6 +891,15 @@ namespace ArchiSteamFarm.Localization { } } + /// + /// Looks up a localized string similar to Unused keys: {0}. + /// + internal static string UnusedKeys { + get { + return ResourceManager.GetString("UnusedKeys", resourceCulture); + } + } + /// /// Looks up a localized string similar to Checking for new version.... /// diff --git a/ArchiSteamFarm/Localization/Strings.resx b/ArchiSteamFarm/Localization/Strings.resx index d36d9da32..0539e232e 100644 --- a/ArchiSteamFarm/Localization/Strings.resx +++ b/ArchiSteamFarm/Localization/Strings.resx @@ -371,6 +371,25 @@ StackTrace: Starting WCF server on {0}... {0} will be replaced by WCF hostname + + That bot instance is already stopped! + + + Couldn't find any bot named {0}! + {0} will be replaced by bot's name + + + There are {0}/{1} bots running, with total of {2} games ({3} cards) left to idle. + {0} will be replaced by number of active bots, {1} will be replaced by total number of bots, {2} will be replaced by total number of games left to idle, {3} will be replaced by total number of cards left to idle + + + Bot {0} is idling game: {1} ({2}, {3} card drops remaining) from a total of {4} games ({5} cards) left to idle (~{6} remaining). + {0} will be replaced by bot's name, {1} will be replaced by game's appID (number), {2} will be replaced by game's name, {3} will be replaced by number of cards left to idle, {4} will be replaced by total number of games to idle, {5} will be replaced by total number of cards to idle, {6} will be replaced by translated TimeSpan string built from TimeSpan* translation parts + + + Bot {0} is idling games: {1} from a total of {2} games ({3} cards) left to idle (~{4} remaining). + {0} will be replaced by bot's name, {1} will be replaced by list of the games (appIDs, numbers), {2} will be replaced by total number of games to idle, {3} will be replaced by total number of cards to idle, {4} will be replaced by translated TimeSpan string built from TimeSpan* translation parts + Checking first badge page... @@ -381,6 +400,9 @@ StackTrace: Chosen farming algorithm: {0} {0} will be replaced by the name of chosen farming algorithm + + Done! + We have a total of {0} games ({1} cards) left to idle (~{3} remaining)... {0} will be replaced by number of games, {1} will be replaced by number of cards, {2} will be replaced by translated TimeSpan string built from TimeSpan* translation parts @@ -436,6 +458,9 @@ StackTrace: Stopped idling: {0} {0} will be replaced by list of the games (appIDs, numbers), separated by a comma + + Unknown command! + Could not get badges information, we will try again later! @@ -443,4 +468,86 @@ StackTrace: Could not check cards status for: {0} ({1}), we will try again later! {0} will be replaced by game's appID (number), {1} will be replaced by game's name + + That bot instance is already running! + {0} will be replaced by bot's name + + + Automatic idling is now paused! + + + 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 resumed! + + + Automatic idling is resumed already! + + + [{0}] password: {1} + {0} will be replaced by password encryption method (string), {1} will be replaced by encrypted password using that method (string) + + + Looting is now disabled! + + + Looting is now enabled! + + + This bot instance is not connected! + {0} will be replaced by bot's name + + + <{0}> Not owned yet: {1} + {0} will be replaced by bot's name, {1} will be replaced by query (string) + + + <{0}> Owned already: {1} | {2} + {0} will be replaced by bot's name, {1} will be replaced by game's appID (number), {2} will be replaced by game's name + + + <{0}> Key: {1} | Status: {2} + {0} will be replaced by bot's name, {1} will be replaced by cd-key (string), {2} will be replaced by status string + + + <{0}> Key: {1} | Status: {2} | Items: {3} + {0} will be replaced by bot's name, {1} will be replaced by cd-key (string), {2} will be replaced by status string, {3} will be replaced by list of key-value pairs, separated by a comma + + + Bot {0} is not idling anything. + {0} will be replaced by bot's name + + + Bot {0} is limited and can't drop any cards through idling. + {0} will be replaced by bot's name + + + Bot {0} is not connected. + {0} will be replaced by bot's name + + + Bot {0} is not running. + {0} will be replaced by bot's name + + + Bot {0} is paused or running in manual mode. + {0} will be replaced by bot's name + + + Bot {0} is currently being used. + {0} will be replaced by bot's name + + + {0} is empty! + {0} will be replaced by object's name + + + Unused keys: {0} + {0} will be replaced by list of cd-keys (strings), separated by a comma + \ No newline at end of file