diff --git a/ASFEnhance/Account/Command.cs b/ASFEnhance/Account/Command.cs index 48a146c6..43c8d7ed 100644 --- a/ASFEnhance/Account/Command.cs +++ b/ASFEnhance/Account/Command.cs @@ -894,7 +894,7 @@ private static string NotificationTargetToString(NotificationTarget target) } } - return bot.FormatBotResponse("收到礼物 {0} 个, 接收成功 {1} 个", giftCount, successCount); + return bot.FormatBotResponse(Langs.ReceiveGiftResult, giftCount, successCount); } /// @@ -928,6 +928,7 @@ private static string NotificationTargetToString(NotificationTarget target) /// 获取游玩时间 /// /// + /// /// internal static async Task ResponseGetPlayTime(Bot bot, string? query) { @@ -964,7 +965,7 @@ private static string NotificationTargetToString(NotificationTarget target) } else { - sb.AppendFormat("{0}: 无效的AppId", entry); + sb.AppendFormat(Langs.InvalidAppId, entry); } } } @@ -983,19 +984,19 @@ private static string NotificationTargetToString(NotificationTarget target) { if (result.TryGetValue(appId, out var game)) { - sb.AppendLineFormat("{0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}]", appId, game.Name, game.PlayTimeForever / 60.0, game.PlayTime2Weeks / 60.0); + sb.AppendLineFormat(Langs.PlayTimeItem, appId, game.Name, game.PlayTimeForever / 60.0, game.PlayTime2Weeks / 60.0); totalHours += game.PlayTimeForever; twoWeekHours += game.PlayTime2Weeks; } else { - sb.AppendLineFormat("{0}: 无游玩时长数据", appId); + sb.AppendLineFormat(Langs.NoPlayTimeInfo, appId); } } } else { - sb.AppendLine("未指定游戏, 统计所有游戏"); + sb.AppendLine(Langs.AllPlayTimeInfo); foreach (var game in result.Values) { totalHours += game.PlayTimeForever; @@ -1003,7 +1004,7 @@ private static string NotificationTargetToString(NotificationTarget target) } } - sb.AppendLineFormat("累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h", totalHours / 60.0, twoWeekHours / 60.0); + sb.AppendLineFormat(Langs.TotalPlayTimeItem, totalHours / 60.0, twoWeekHours / 60.0); return bot.FormatBotResponse(sb.ToString()); } @@ -1012,6 +1013,7 @@ private static string NotificationTargetToString(NotificationTarget target) /// 获取游玩时间 (多个Bot) /// /// + /// /// /// internal static async Task ResponseGetPlayTime(string botNames, string? query) diff --git a/ASFEnhance/Data/GetOwnedGamesResponse.cs b/ASFEnhance/Data/GetOwnedGamesResponse.cs index 5610eb80..32e507b7 100644 --- a/ASFEnhance/Data/GetOwnedGamesResponse.cs +++ b/ASFEnhance/Data/GetOwnedGamesResponse.cs @@ -1,9 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ASFEnhance.Data; internal sealed record GetOwnedGamesResponse diff --git a/ASFEnhance/Localization/Langs.Designer.cs b/ASFEnhance/Localization/Langs.Designer.cs index a7a78777..2c434b30 100644 --- a/ASFEnhance/Localization/Langs.Designer.cs +++ b/ASFEnhance/Localization/Langs.Designer.cs @@ -204,6 +204,15 @@ internal static string AddFriendSuccess { } } + /// + /// 查找类似 未指定游戏, 统计所有游戏 的本地化字符串。 + /// + internal static string AllPlayTimeInfo { + get { + return ResourceManager.GetString("AllPlayTimeInfo", resourceCulture); + } + } + /// /// 查找类似 当前已经是最新版本, 无需更新插件 的本地化字符串。 /// @@ -1293,6 +1302,15 @@ internal static string HelpArgsExplain { } } + /// + /// 查找类似 {0}: 无效的AppId 的本地化字符串。 + /// + internal static string InvalidAppId { + get { + return ResourceManager.GetString("InvalidAppId", resourceCulture); + } + } + /// /// 查找类似 已加入 的本地化字符串。 /// @@ -1491,6 +1509,15 @@ internal static string NooWishlistOnSale { } } + /// + /// 查找类似 {0}: 无游玩时长数据 的本地化字符串。 + /// + internal static string NoPlayTimeInfo { + get { + return ResourceManager.GetString("NoPlayTimeInfo", resourceCulture); + } + } + /// /// 查找类似 未关注任何鉴赏家 的本地化字符串。 /// @@ -1563,6 +1590,15 @@ internal static string ParseHtmlFailed { } } + /// + /// 查找类似 {0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}] 的本地化字符串。 + /// + internal static string PlayTimeItem { + get { + return ResourceManager.GetString("PlayTimeItem", resourceCulture); + } + } + /// /// 查找类似 作者 Chr_, 联系方式 chr@chrxw.com 的本地化字符串。 /// @@ -2022,6 +2058,15 @@ internal static string PurchaseHistoryTypeWalletPurchase { } } + /// + /// 查找类似 收到礼物 {0} 个, 接收成功 {1} 个 的本地化字符串。 + /// + internal static string ReceiveGiftResult { + get { + return ResourceManager.GetString("ReceiveGiftResult", resourceCulture); + } + } + /// /// 查找类似 评测发布失败: {0} 的本地化字符串。 /// @@ -2238,6 +2283,15 @@ internal static string Success { } } + /// + /// 查找类似 累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h 的本地化字符串。 + /// + internal static string TotalPlayTimeItem { + get { + return ResourceManager.GetString("TotalPlayTimeItem", resourceCulture); + } + } + /// /// 查找类似 成功取关 {0} 个鉴赏家, 共计 {1} 个鉴赏家 的本地化字符串。 /// diff --git a/ASFEnhance/Localization/Langs.en-US.resx b/ASFEnhance/Localization/Langs.en-US.resx index 466a2381..425206db 100644 --- a/ASFEnhance/Localization/Langs.en-US.resx +++ b/ASFEnhance/Localization/Langs.en-US.resx @@ -1074,4 +1074,22 @@ Send {0} requests successful + + No appId proivded, sum all playtime + + + {0}: Invalid appId + + + {0}: No playtime info + + + {0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}] + + + 收到礼物 {0} 个, 接收成功 {1} 个 + + + 累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h + \ No newline at end of file diff --git a/ASFEnhance/Localization/Langs.resx b/ASFEnhance/Localization/Langs.resx index 556b36f0..0d2c29b7 100644 --- a/ASFEnhance/Localization/Langs.resx +++ b/ASFEnhance/Localization/Langs.resx @@ -1074,4 +1074,22 @@ {0} 个封禁 + + 收到礼物 {0} 个, 接收成功 {1} 个 + + + {0}: 无效的AppId + + + {0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}] + + + {0}: 无游玩时长数据 + + + 未指定游戏, 统计所有游戏 + + + 累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h + \ No newline at end of file diff --git a/ASFEnhance/Localization/Langs.ru-RU.resx b/ASFEnhance/Localization/Langs.ru-RU.resx index 6a613c90..60abce35 100644 --- a/ASFEnhance/Localization/Langs.ru-RU.resx +++ b/ASFEnhance/Localization/Langs.ru-RU.resx @@ -1074,4 +1074,22 @@ Отправлено {0} запросов успешно + + 未指定游戏, 统计所有游戏 + + + {0}: 无效的AppId + + + {0}: 无游玩时长数据 + + + {0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}] + + + 收到礼物 {0} 个, 接收成功 {1} 个 + + + 累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h + \ No newline at end of file diff --git a/ASFEnhance/Localization/Langs.zh-Hans.resx b/ASFEnhance/Localization/Langs.zh-Hans.resx index 7ef1c4dc..bc182641 100644 --- a/ASFEnhance/Localization/Langs.zh-Hans.resx +++ b/ASFEnhance/Localization/Langs.zh-Hans.resx @@ -1074,4 +1074,22 @@ 成功发送 {0} 个请求 + + 未指定游戏, 统计所有游戏 + + + {0}: 无效的AppId + + + {0}: 无游玩时长数据 + + + {0}: 游玩时长 {2:F2}h 2周游玩时长 {3:F2}h [{1}] + + + 收到礼物 {0} 个, 接收成功 {1} 个 + + + 累计游玩时长: {0:F2}h 2周游玩时长: {1:F2}h + \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 2af1124c..c0694cec 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 1.8.13.1 + 1.8.14.0