Pass full translation dictionary to TranslationGuildContext and decide there whether to use singular or plural
This commit is contained in:
parent
b309f155be
commit
495288b887
3 changed files with 7 additions and 8 deletions
|
@ -127,19 +127,18 @@ namespace Geekbot.net.Lib.Localization
|
|||
return translation;
|
||||
}
|
||||
|
||||
private async Task<Dictionary<string, string>> GetDict(ICommandContext context)
|
||||
private async Task<Dictionary<string, List<string>>> GetDict(ICommandContext context)
|
||||
{
|
||||
try
|
||||
{
|
||||
var command = context.Message.Content.Split(' ').First().TrimStart('!').ToLower();
|
||||
var serverLanguage = await GetServerLanguage(context.Guild?.Id ?? 0);
|
||||
return _translations[serverLanguage][command]
|
||||
.ToDictionary(dict => dict.Key, dict => dict.Value.First());
|
||||
return _translations[serverLanguage][command];
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Error(LogSource.Geekbot, "No translations for command found", e);
|
||||
return new Dictionary<string, string>();
|
||||
return new Dictionary<string, List<string>>();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue