Make Translations easier to get

This commit is contained in:
Runebaas 2017-11-16 00:51:36 +01:00
parent 7584b09d35
commit f0ba7bb9fc
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
4 changed files with 78 additions and 26 deletions

View file

@ -5,7 +5,6 @@ using Discord;
using Discord.Commands;
using Discord.WebSocket;
using Geekbot.net.Lib;
using Serilog;
using StackExchange.Redis;
namespace Geekbot.net.Commands
@ -121,7 +120,8 @@ namespace Geekbot.net.Commands
var success = _translation.SetLanguage(Context.Guild.Id, language);
if (success)
{
await ReplyAsync(_translation.GetString(Context.Guild.Id, "LanguageChanger", "Confirm"));
var trans = _translation.GetDict(Context);
await ReplyAsync(trans["Confirm"]);
return;
}
await ReplyAsync(
@ -132,5 +132,21 @@ namespace Geekbot.net.Commands
_errorHandler.HandleCommandException(e, Context);
}
}
[Command("lang", RunMode = RunMode.Async)]
[Remarks(CommandCategories.Admin)]
[Summary("Change the bots language")]
public async Task getLanguage()
{
try
{
var trans = _translation.GetDict(Context);
await ReplyAsync(trans["GetLanguage"]);
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
}
}
}
}