diff --git a/src/NadekoBot/Modules/Administration/Commands/LocalizationCommands.cs b/src/NadekoBot/Modules/Administration/Commands/LocalizationCommands.cs index 2db38bc7..7247c29d 100644 --- a/src/NadekoBot/Modules/Administration/Commands/LocalizationCommands.cs +++ b/src/NadekoBot/Modules/Administration/Commands/LocalizationCommands.cs @@ -4,6 +4,7 @@ using NadekoBot.Attributes; using NadekoBot.Extensions; using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Globalization; using System.Linq; using System.Text; @@ -16,10 +17,16 @@ namespace NadekoBot.Modules.Administration [Group] public class LocalizationCommands : ModuleBase { + private ImmutableDictionary SupportedLocales { get; } = new Dictionary() + { + {"en-US", "English, United States" }, + {"sr-cyrl-rs", "Serbian, Cyrillic" } + }.ToImmutableDictionary(); + [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] [RequireUserPermission(GuildPermission.Administrator)] - public async Task SetLocale([Remainder] string name = null) + public async Task SetLanguage([Remainder] string name = null) { CultureInfo ci = null; try @@ -35,7 +42,7 @@ namespace NadekoBot.Modules.Administration NadekoBot.Localization.SetGuildCulture(Context.Guild, ci); } - await Context.Channel.SendConfirmAsync($"Your guild's locale is now {Format.Bold(ci.ToString())} - {Format.Bold(ci.NativeName)}.").ConfigureAwait(false); + await Context.Channel.SendConfirmAsync($"Your server's locale is now {Format.Bold(ci.ToString())} - {Format.Bold(ci.NativeName)}.").ConfigureAwait(false); } catch(Exception) { @@ -46,7 +53,7 @@ namespace NadekoBot.Modules.Administration [NadekoCommand, Usage, Description, Aliases] [OwnerOnly] - public async Task SetDefaultLocale(string name) + public async Task SetDefaultLanguage(string name) { CultureInfo ci = null; try @@ -70,6 +77,14 @@ namespace NadekoBot.Modules.Administration await Context.Channel.SendConfirmAsync($"Failed setting locale. Revisit this command's help.").ConfigureAwait(false); } } + + [NadekoCommand, Usage, Description, Aliases] + [OwnerOnly] + public async Task ListLanguages(string name) + { + await Context.Channel.SendConfirmAsync("List Of Languages", + string.Join("\n", SupportedLocales.Select(x => $"{Format.Code(x.Key)} => {x.Value}"))); + } } } } diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index 3c6d7404..11519c80 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -6758,27 +6758,27 @@ namespace NadekoBot.Resources { /// /// Looks up a localized string similar to setdefaultlocale sdl. /// - public static string setdefaultlocale_cmd { + public static string setdefaultlanguage_cmd { get { - return ResourceManager.GetString("setdefaultlocale_cmd", resourceCulture); + return ResourceManager.GetString("setdefaultlanguage_cmd", resourceCulture); } } /// - /// Looks up a localized string similar to Sets the bot's default locale. All servers which use a default locale will use this one. Setting to `default` will use the host's current culture.. + /// Looks up a localized string similar to Sets the bot's default response language. All servers which use a default locale will use this one. Setting to `default` will use the host's current culture.. /// - public static string setdefaultlocale_desc { + public static string setdefaultlanguage_desc { get { - return ResourceManager.GetString("setdefaultlocale_desc", resourceCulture); + return ResourceManager.GetString("setdefaultlanguage_desc", resourceCulture); } } /// /// Looks up a localized string similar to `{0}sdl en-US` or `{0}sdl default`. /// - public static string setdefaultlocale_usage { + public static string setdefaultlanguage_usage { get { - return ResourceManager.GetString("setdefaultlocale_usage", resourceCulture); + return ResourceManager.GetString("setdefaultlanguage_usage", resourceCulture); } } @@ -6812,27 +6812,27 @@ namespace NadekoBot.Resources { /// /// Looks up a localized string similar to setlocale sl. /// - public static string setlocale_cmd { + public static string setlanguage_cmd { get { - return ResourceManager.GetString("setlocale_cmd", resourceCulture); + return ResourceManager.GetString("setlanguage_cmd", resourceCulture); } } /// - /// Looks up a localized string similar to Sets this server's response locale (language). If bot's response strings have been translated to that language, bot will use that language in this server. Reset by using `default` as the locale name.. + /// Looks up a localized string similar to Sets this server's response language) If bot's response strings have been translated to that language, bot will use that language in this server. Reset by using `default` as the locale name.. /// - public static string setlocale_desc { + public static string setlanguage_desc { get { - return ResourceManager.GetString("setlocale_desc", resourceCulture); + return ResourceManager.GetString("setlanguage_desc", resourceCulture); } } /// /// Looks up a localized string similar to `{0}sl de-DE ` or `{0}sl default`. /// - public static string setlocale_usage { + public static string setlanguage_usage { get { - return ResourceManager.GetString("setlocale_usage", resourceCulture); + return ResourceManager.GetString("setlanguage_usage", resourceCulture); } } diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index 577a1b72..23fb8072 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -3105,22 +3105,22 @@ `{0}timezone` - + setdefaultlocale sdl - - Sets the bot's default locale. All servers which use a default locale will use this one. Setting to `default` will use the host's current culture. + + Sets the bot's default response language. All servers which use a default locale will use this one. Setting to `default` will use the host's current culture. - + `{0}sdl en-US` or `{0}sdl default` - + setlocale sl - - Sets this server's response locale (language). If bot's response strings have been translated to that language, bot will use that language in this server. Reset by using `default` as the locale name. + + Sets this server's response language) If bot's response strings have been translated to that language, bot will use that language in this server. Reset by using `default` as the locale name. - + `{0}sl de-DE ` or `{0}sl default` \ No newline at end of file diff --git a/src/NadekoBot/Resources/ResponseStrings-sr-SP.Designer.cs b/src/NadekoBot/Resources/ResponseStrings.sr-cyrl-rs.Designer.cs similarity index 100% rename from src/NadekoBot/Resources/ResponseStrings-sr-SP.Designer.cs rename to src/NadekoBot/Resources/ResponseStrings.sr-cyrl-rs.Designer.cs diff --git a/src/NadekoBot/Resources/ResponseStrings-sr-SP.resx b/src/NadekoBot/Resources/ResponseStrings.sr-cyrl-rs.resx similarity index 82% rename from src/NadekoBot/Resources/ResponseStrings-sr-SP.resx rename to src/NadekoBot/Resources/ResponseStrings.sr-cyrl-rs.resx index 63ef2430..218a7645 100644 --- a/src/NadekoBot/Resources/ResponseStrings-sr-SP.resx +++ b/src/NadekoBot/Resources/ResponseStrings.sr-cyrl-rs.resx @@ -118,70 +118,70 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - {0} has already fainted. + {0} је већ онесвешћен. - {0} already has full HP. + {0} је већ потпуно здрав. - Your type is already {0} + Твој тип већ јесте {0} - used {0}{1} on {2}{3} for {4} damage. + је искористио {0}{1} на {2}{3} и нанео {4} штете. Kwoth used punch:type_icon: on Sanity:type_icon: for 50 damage. - You can't attack again without retaliation! + Не можеш напасти пре узвратног ударца. - You can't attack yourself. + Не можеш напасти себе. - {0} has fainted! + {0} се онесвестио. - healed {0} with one {1} + је излечио {0} са једним {1} - {0} has {1} HP remaining. + {0} има {1} преосталог здравља. - You can't use {0}. Type `{1}ml` to see a list of moves you can use. + Не можеш искористити {0}. Укуцај `{1}ml` да би видео листу удараца које можеш користити. - Movelist for {0} type + Листа покрета за {0} тип - It's not effective. + Није ефективно. - You don't have enough {0} + Немаш довољно {0} - revived {0} with one {1} + је оживео {0} са једним {1} - You revived yourself with one {0} + Оживео си себе са једним {0} - Your type has been changed to {0} for a {1} + Твој тип је промењен на {0} за један {1} - It's somewhat effective. + Има неког ефекта! - It's super effective! + Супер ефективно! - You used too many moves in a row, so you can't move! + Користио си превише напада узастопно, не можеш да се крећеш! - Type of {0} is {1} + {0}-ов тип је {1} - User not found. + Корисник није нађен. - You fainted, so you are not able to move! + Онесвешћен си, не можеш да се крећеш. \ No newline at end of file