diff --git a/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs b/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs index b67f5d3e..0dfb3d0a 100644 --- a/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs +++ b/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs @@ -102,14 +102,14 @@ namespace NadekoBot.Modules.Administration if (shard == null) { - await Context.Channel.SendErrorAsync("No shard by that id found.").ConfigureAwait(false); + await ReplyErrorLocalized("no_shard_id").ConfigureAwait(false); return; } try { - await Context.Channel.SendConfirmAsync($"Shard **#{shardid}** reconnecting.").ConfigureAwait(false); + await ReplyConfirmLocalized("shard_reconnecting", Format.Bold("#" + shardid)).ConfigureAwait(false); await shard.ConnectAsync().ConfigureAwait(false); - await Context.Channel.SendConfirmAsync($"Shard **#{shardid}** reconnected.").ConfigureAwait(false); + await ReplyConfirmLocalized("shard_reconnected", Format.Bold("#" + shardid)).ConfigureAwait(false); } catch (Exception ex) { @@ -127,18 +127,18 @@ namespace NadekoBot.Modules.Administration if (server == null) { - await Context.Channel.SendErrorAsync("⚠️ Cannot find that server").ConfigureAwait(false); + await ReplyErrorLocalized("no_server").ConfigureAwait(false); return; } if (server.OwnerId != NadekoBot.Client.CurrentUser.Id) { await server.LeaveAsync().ConfigureAwait(false); - await Context.Channel.SendConfirmAsync("✅ Left server " + server.Name).ConfigureAwait(false); + await ReplyConfirmLocalized("left_server", Format.Bold(server.Name)).ConfigureAwait(false); } else { await server.DeleteAsync().ConfigureAwait(false); - await Context.Channel.SendConfirmAsync("Deleted server " + server.Name).ConfigureAwait(false); + await ReplyConfirmLocalized("deleted_server",Format.Bold(server.Name)).ConfigureAwait(false); } } @@ -147,7 +147,14 @@ namespace NadekoBot.Modules.Administration [OwnerOnly] public async Task Die() { - try { await Context.Channel.SendConfirmAsync("ℹ️ **Shutting down.**").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } + try + { + await ReplyConfirmLocalized("shutting_down").ConfigureAwait(false); + } + catch + { + // ignored + } await Task.Delay(2000).ConfigureAwait(false); Environment.Exit(0); } @@ -161,7 +168,7 @@ namespace NadekoBot.Modules.Administration await NadekoBot.Client.CurrentUser.ModifyAsync(u => u.Username = newName).ConfigureAwait(false); - await Context.Channel.SendConfirmAsync($"Bot name changed to **{newName}**").ConfigureAwait(false); + await ReplyConfirmLocalized("bot_name", Format.Bold(newName)).ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] @@ -170,7 +177,7 @@ namespace NadekoBot.Modules.Administration { await NadekoBot.Client.SetStatusAsync(SettableUserStatusToUserStatus(status)).ConfigureAwait(false); - await Context.Channel.SendConfirmAsync($"Bot status changed to **{status}**").ConfigureAwait(false); + await ReplyConfirmLocalized("bot_status", Format.Bold(status.ToString())).ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] @@ -192,7 +199,7 @@ namespace NadekoBot.Modules.Administration } } - await Context.Channel.SendConfirmAsync("🆒 **New avatar set.**").ConfigureAwait(false); + await ReplyConfirmLocalized("set_avatar").ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] @@ -201,7 +208,7 @@ namespace NadekoBot.Modules.Administration { await NadekoBot.Client.SetGameAsync(game).ConfigureAwait(false); - await Context.Channel.SendConfirmAsync("👾 **New game set.**").ConfigureAwait(false); + await ReplyConfirmLocalized("set_game").ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] @@ -212,7 +219,7 @@ namespace NadekoBot.Modules.Administration await NadekoBot.Client.SetGameAsync(name, url, StreamType.Twitch).ConfigureAwait(false); - await Context.Channel.SendConfirmAsync("ℹ️ **New stream set.**").ConfigureAwait(false); + await ReplyConfirmLocalized("set_stream").ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] @@ -253,8 +260,10 @@ namespace NadekoBot.Modules.Administration } else { - await Context.Channel.SendErrorAsync("⚠️ Invalid format.").ConfigureAwait(false); + await ReplyErrorLocalized("invalid_format").ConfigureAwait(false); + return; } + await ReplyConfirmLocalized("message_sent").ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] @@ -264,10 +273,10 @@ namespace NadekoBot.Modules.Administration var channels = NadekoBot.Client.GetGuilds().Select(g => g.DefaultChannel).ToArray(); if (channels == null) return; - await Task.WhenAll(channels.Where(c => c != null).Select(c => c.SendConfirmAsync($"🆕 Message from {Context.User} `[Bot Owner]`:", message))) + await Task.WhenAll(channels.Where(c => c != null).Select(c => c.SendConfirmAsync(GetText("message_from_bo", Context.User.ToString()), message))) .ConfigureAwait(false); - await Context.Channel.SendConfirmAsync("🆗").ConfigureAwait(false); + await ReplyConfirmLocalized("message_sent").ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] @@ -275,7 +284,7 @@ namespace NadekoBot.Modules.Administration public async Task ReloadImages() { var time = await NadekoBot.Images.Reload().ConfigureAwait(false); - await Context.Channel.SendConfirmAsync($"Images loaded after {time.TotalSeconds:F3}s!").ConfigureAwait(false); + await ReplyConfirmLocalized("images_loaded", time.TotalSeconds.ToString("F3")).ConfigureAwait(false); } private static UserStatus SettableUserStatusToUserStatus(SettableUserStatus sus) diff --git a/src/NadekoBot/Resources/ResponseStrings.Designer.cs b/src/NadekoBot/Resources/ResponseStrings.Designer.cs index 5afd534e..74cc34e8 100644 --- a/src/NadekoBot/Resources/ResponseStrings.Designer.cs +++ b/src/NadekoBot/Resources/ResponseStrings.Designer.cs @@ -59,24 +59,6 @@ namespace NadekoBot.Resources { } } - /// - /// Looks up a localized string similar to You already have {0} role.. - /// - public static string administartion_self_assign_already { - get { - return ResourceManager.GetString("administartion_self_assign_already", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You no longer have {0} role.. - /// - public static string administartion_self_assign_remove { - get { - return ResourceManager.GetString("administartion_self_assign_remove", resourceCulture); - } - } - /// /// Looks up a localized string similar to **Auto assign role** on user join is now **disabled**.. /// @@ -122,6 +104,24 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to Bot name changed to {0}. + /// + public static string administration_bot_name { + get { + return ResourceManager.GetString("administration_bot_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bot status changed to {0}. + /// + public static string administration_bot_status { + get { + return ResourceManager.GetString("administration_bot_status", resourceCulture); + } + } + /// /// Looks up a localized string similar to Channel Name Changed. /// @@ -158,6 +158,15 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to Deleted server {0}. + /// + public static string administration_deleted_server { + get { + return ResourceManager.GetString("administration_deleted_server", resourceCulture); + } + } + /// /// Looks up a localized string similar to DM from. /// @@ -203,6 +212,24 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to Images loaded after {0} seconds!. + /// + public static string administration_images_loaded { + get { + return ResourceManager.GetString("administration_images_loaded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid input format.. + /// + public static string administration_invalid_format { + get { + return ResourceManager.GetString("administration_invalid_format", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid parameters.. /// @@ -285,6 +312,15 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to Left server {0}. + /// + public static string administration_left_server { + get { + return ResourceManager.GetString("administration_left_server", resourceCulture); + } + } + /// /// Looks up a localized string similar to Logging {0} event in this channel.. /// @@ -348,6 +384,24 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to Message from {0} `[Bot Owner]`:. + /// + public static string administration_message_from_bo { + get { + return ResourceManager.GetString("administration_message_from_bo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Message sent.. + /// + public static string administration_message_sent { + get { + return ResourceManager.GetString("administration_message_sent", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} moved from {1} to {2}. /// @@ -447,6 +501,24 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to Can't find that server. + /// + public static string administration_no_server { + get { + return ResourceManager.GetString("administration_no_server", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No shard with that ID found.. + /// + public static string administration_no_shard_id { + get { + return ResourceManager.GetString("administration_no_shard_id", resourceCulture); + } + } + /// /// Looks up a localized string similar to Old Message. /// @@ -628,6 +700,15 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to You already have {0} role.. + /// + public static string administration_self_assign_already { + get { + return ResourceManager.GetString("administration_self_assign_already", resourceCulture); + } + } + /// /// Looks up a localized string similar to You already have {0} exclusive self-assigned role.. /// @@ -700,6 +781,15 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to You no longer have {0} role.. + /// + public static string administration_self_assign_remove { + get { + return ResourceManager.GetString("administration_self_assign_remove", resourceCulture); + } + } + /// /// Looks up a localized string similar to You now have {0} role.. /// @@ -709,6 +799,60 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to New avatar set!. + /// + public static string administration_set_avatar { + get { + return ResourceManager.GetString("administration_set_avatar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New game set!. + /// + public static string administration_set_game { + get { + return ResourceManager.GetString("administration_set_game", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New stream set!. + /// + public static string administration_set_stream { + get { + return ResourceManager.GetString("administration_set_stream", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shard {0} reconnected.. + /// + public static string administration_shard_reconnected { + get { + return ResourceManager.GetString("administration_shard_reconnected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shard {0} reconnecting.. + /// + public static string administration_shard_reconnecting { + get { + return ResourceManager.GetString("administration_shard_reconnecting", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shutting down. + /// + public static string administration_shutting_down { + get { + return ResourceManager.GetString("administration_shutting_down", resourceCulture); + } + } + /// /// Looks up a localized string similar to Users can't send more than {0} messages every {1} seconds.. /// diff --git a/src/NadekoBot/Resources/ResponseStrings.resx b/src/NadekoBot/Resources/ResponseStrings.resx index 1d1aaaca..382b6c14 100644 --- a/src/NadekoBot/Resources/ResponseStrings.resx +++ b/src/NadekoBot/Resources/ResponseStrings.resx @@ -298,12 +298,6 @@ You fainted, so you are not able to move! - - You already have {0} role. - - - You no longer have {0} role. - **Auto assign role** on user join is now **disabled**. @@ -320,6 +314,12 @@ banned PLURAL + + Bot name changed to {0} + + + Bot status changed to {0} + Channel Name Changed @@ -332,6 +332,9 @@ Content + + Deleted server {0} + DM from @@ -347,6 +350,12 @@ I will stop forwarding DMs from now on. + + Images loaded after {0} seconds! + + + Invalid input format. + Invalid parameters. @@ -375,6 +384,9 @@ {0} has left {1} + + Left server {0} + Logging {0} event in this channel. @@ -396,6 +408,12 @@ Stopped logging {0} event. + + Message from {0} `[Bot Owner]`: + + + Message sent. + {0} moved from {1} to {2} @@ -431,6 +449,12 @@ Nickname Changed + + Can't find that server + + + No shard with that ID found. + Old Message @@ -468,7 +492,7 @@ Removed the playing message: {0} - Role {0} is added to the list. + Role {0} as been added to the list. {0} not found.Cleaned up. @@ -492,6 +516,9 @@ No rotating playing statuses set. + + You already have {0} role. + You already have {0} exclusive self-assigned role. @@ -499,8 +526,7 @@ Self assigned roles are now exclusive! - There are {0} self assignable roles: -{1} + There are {0} self assignable roles That role is not self-assignable. @@ -517,9 +543,30 @@ {0} has been removed from the list of self-assignable roles. - + + You no longer have {0} role. + + You now have {0} role. + + New avatar set! + + + New game set! + + + New stream set! + + + Shard {0} reconnected. + + + Shard {0} reconnecting. + + + Shutting down + Users can't send more than {0} messages every {1} seconds.