diff --git a/src/Bot/Bot.csproj b/src/Bot/Bot.csproj
index c7889ae..601766a 100644
--- a/src/Bot/Bot.csproj
+++ b/src/Bot/Bot.csproj
@@ -40,4 +40,92 @@
+
+
+ ResXFileCodeGenerator
+ Ship.Designer.cs
+
+
+ ResXFileCodeGenerator
+ Rank.Designer.cs
+
+
+ ResXFileCodeGenerator
+ Karma.Designer.cs
+
+
+ ResXFileCodeGenerator
+ Internal.Designer.cs
+
+
+ ResXFileCodeGenerator
+ Cookies.Designer.cs
+
+
+ ResXFileCodeGenerator
+ Roll.Designer.cs
+
+
+ ResXFileCodeGenerator
+ Choose.Designer.cs
+
+
+ ResXFileCodeGenerator
+ Admin.Designer.cs
+
+
+ ResXFileCodeGenerator
+ Quote.Designer.cs
+
+
+
+
+ True
+ True
+ ship.resx
+
+
+ True
+ True
+ Rank.resx
+
+
+ Ship.resx
+
+
+ True
+ True
+ Karma.resx
+
+
+ True
+ True
+ Internal.resx
+
+
+ True
+ True
+ Cookies.resx
+
+
+ True
+ True
+ Roll.resx
+
+
+ True
+ True
+ Choose.resx
+
+
+ True
+ True
+ Admin.resx
+
+
+ True
+ True
+ Quote.resx
+
+
diff --git a/src/Bot/Commands/Admin/Admin.cs b/src/Bot/Commands/Admin/Admin.cs
index f6c4210..2627f86 100644
--- a/src/Bot/Commands/Admin/Admin.cs
+++ b/src/Bot/Commands/Admin/Admin.cs
@@ -1,9 +1,15 @@
using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Resources;
using System.Text;
+using System.Threading;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Discord.WebSocket;
+using Geekbot.Core;
using Geekbot.Core.CommandPreconditions;
using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Extensions;
@@ -15,19 +21,15 @@ namespace Geekbot.Bot.Commands.Admin
[Group("admin")]
[RequireUserPermission(GuildPermission.Administrator)]
[DisableInDirectMessage]
- public class Admin : ModuleBase
+ public class Admin : GeekbotCommandBase
{
private readonly DiscordSocketClient _client;
- private readonly IErrorHandler _errorHandler;
private readonly IGuildSettingsManager _guildSettingsManager;
- private readonly ITranslationHandler _translation;
- public Admin(DiscordSocketClient client, IErrorHandler errorHandler, IGuildSettingsManager guildSettingsManager, ITranslationHandler translationHandler)
+ public Admin(DiscordSocketClient client, IErrorHandler errorHandler, IGuildSettingsManager guildSettingsManager, ITranslationHandler translationHandler) : base(errorHandler, translationHandler)
{
_client = client;
- _errorHandler = errorHandler;
_guildSettingsManager = guildSettingsManager;
- _translation = translationHandler;
}
[Command("welcome", RunMode = RunMode.Async)]
@@ -60,7 +62,7 @@ namespace Geekbot.Bot.Commands.Admin
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context, "That channel doesn't seem to exist or i don't have write permissions");
+ await ErrorHandler.HandleCommandException(e, Context, "That channel doesn't seem to exist or i don't have write permissions");
}
}
@@ -84,7 +86,7 @@ namespace Geekbot.Bot.Commands.Admin
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context, "That channel doesn't seem to exist or i don't have write permissions");
+ await ErrorHandler.HandleCommandException(e, Context, "That channel doesn't seem to exist or i don't have write permissions");
}
}
@@ -107,7 +109,7 @@ namespace Geekbot.Bot.Commands.Admin
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -130,7 +132,7 @@ namespace Geekbot.Bot.Commands.Admin
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -141,24 +143,30 @@ namespace Geekbot.Bot.Commands.Admin
try
{
var language = languageRaw.ToUpper();
- var success = await _translation.SetLanguage(Context.Guild.Id, language);
+ var success = await Translations.SetLanguage(Context.Guild.Id, language);
if (success)
{
var guild = _guildSettingsManager.GetSettings(Context.Guild.Id);
guild.Language = language;
await _guildSettingsManager.UpdateSettings(guild);
- var transContext = await _translation.GetGuildContext(Context);
- await ReplyAsync(transContext.GetString("NewLanguageSet"));
+ if (language.ToLower() == "chde")
+ {
+ Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("de-ch");
+ }
+
+ await ReplyAsync(Localization.Admin.NewLanguageSet);
return;
}
- await ReplyAsync(
- $"That doesn't seem to be a supported language\r\nSupported Languages are {string.Join(", ", _translation.SupportedLanguages)}");
+ var available = new List();
+ available.Add("en-GB"); // default
+ available.AddRange(GetAvailableCultures().Select(culture => culture.Name));
+ await ReplyAsync($"That doesn't seem to be a supported language\nSupported Languages are {string.Join(", ", available)}");
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -177,7 +185,7 @@ namespace Geekbot.Bot.Commands.Admin
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -194,7 +202,7 @@ namespace Geekbot.Bot.Commands.Admin
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -211,7 +219,7 @@ namespace Geekbot.Bot.Commands.Admin
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -230,5 +238,30 @@ namespace Geekbot.Bot.Commands.Admin
return null;
}
}
+
+ private IEnumerable GetAvailableCultures()
+ {
+ var result = new List();
+ var rm = new ResourceManager(typeof(Localization.Admin));
+ var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
+ foreach (var culture in cultures)
+ {
+ try
+ {
+ if (culture.Equals(CultureInfo.InvariantCulture)) continue; //do not use "==", won't work
+
+ var rs = rm.GetResourceSet(culture, true, false);
+ if (rs != null)
+ {
+ result.Add(culture);
+ }
+ }
+ catch (CultureNotFoundException)
+ {
+ //NOP
+ }
+ }
+ return result;
+ }
}
}
\ No newline at end of file
diff --git a/src/Bot/Commands/Games/Roll/Roll.cs b/src/Bot/Commands/Games/Roll/Roll.cs
index 6241ba1..244edbe 100644
--- a/src/Bot/Commands/Games/Roll/Roll.cs
+++ b/src/Bot/Commands/Games/Roll/Roll.cs
@@ -2,6 +2,7 @@
using System.Linq;
using System.Threading.Tasks;
using Discord.Commands;
+using Geekbot.Core;
using Geekbot.Core.Database;
using Geekbot.Core.Database.Models;
using Geekbot.Core.ErrorHandling;
@@ -12,21 +13,17 @@ using Geekbot.Core.RandomNumberGenerator;
namespace Geekbot.Bot.Commands.Games.Roll
{
- public class Roll : ModuleBase
+ public class Roll : GeekbotCommandBase
{
- private readonly IErrorHandler _errorHandler;
private readonly IKvInMemoryStore _kvInMemoryStore;
- private readonly ITranslationHandler _translation;
private readonly DatabaseContext _database;
private readonly IRandomNumberGenerator _randomNumberGenerator;
- public Roll(IKvInMemoryStore kvInMemoryStore,IErrorHandler errorHandler, ITranslationHandler translation, DatabaseContext database, IRandomNumberGenerator randomNumberGenerator)
+ public Roll(IKvInMemoryStore kvInMemoryStore,IErrorHandler errorHandler, ITranslationHandler translation, DatabaseContext database, IRandomNumberGenerator randomNumberGenerator) : base(errorHandler, translation)
{
_kvInMemoryStore = kvInMemoryStore;
- _translation = translation;
_database = database;
_randomNumberGenerator = randomNumberGenerator;
- _errorHandler = errorHandler;
}
[Command("roll", RunMode = RunMode.Async)]
@@ -37,7 +34,7 @@ namespace Geekbot.Bot.Commands.Games.Roll
{
var number = _randomNumberGenerator.Next(1, 100);
int.TryParse(stuff, out var guess);
- var transContext = await _translation.GetGuildContext(Context);
+ var transContext = await Translations.GetGuildContext(Context);
if (guess <= 100 && guess > 0)
{
var kvKey = $"{Context.Guild.Id}:{Context.User.Id}:RollsPrevious";
@@ -46,8 +43,8 @@ namespace Geekbot.Bot.Commands.Games.Roll
if (prevRoll?.LastGuess == guess && prevRoll?.GuessedOn.AddDays(1) > DateTime.Now)
{
- await ReplyAsync(transContext.GetString(
- "NoPrevGuess",
+ await ReplyAsync(string.Format(
+ Localization.Roll.NoPrevGuess,
Context.Message.Author.Mention,
transContext.FormatDateTimeAsRemaining(prevRoll.GuessedOn.AddDays(1))));
return;
@@ -55,10 +52,10 @@ namespace Geekbot.Bot.Commands.Games.Roll
_kvInMemoryStore.Set(kvKey, new RollTimeout { LastGuess = guess, GuessedOn = DateTime.Now });
- await ReplyAsync(transContext.GetString("Rolled", Context.Message.Author.Mention, number, guess));
+ await ReplyAsync(string.Format(Localization.Roll.Rolled, Context.Message.Author.Mention, number, guess));
if (guess == number)
{
- await ReplyAsync(transContext.GetString("Gratz", Context.Message.Author));
+ await ReplyAsync(string.Format(Localization.Roll.Gratz, Context.Message.Author));
var user = await GetUser(Context.User.Id);
user.Rolls += 1;
_database.Rolls.Update(user);
@@ -67,12 +64,12 @@ namespace Geekbot.Bot.Commands.Games.Roll
}
else
{
- await ReplyAsync(transContext.GetString("RolledNoGuess", Context.Message.Author.Mention, number));
+ await ReplyAsync(string.Format(Localization.Roll.RolledNoGuess, Context.Message.Author.Mention, number));
}
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
diff --git a/src/Bot/Commands/Randomness/Ship.cs b/src/Bot/Commands/Randomness/Ship.cs
index d5d9eea..78f3c99 100644
--- a/src/Bot/Commands/Randomness/Ship.cs
+++ b/src/Bot/Commands/Randomness/Ship.cs
@@ -3,6 +3,7 @@ using System.Linq;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
+using Geekbot.Core;
using Geekbot.Core.Database;
using Geekbot.Core.Database.Models;
using Geekbot.Core.ErrorHandling;
@@ -12,19 +13,15 @@ using Geekbot.Core.RandomNumberGenerator;
namespace Geekbot.Bot.Commands.Randomness
{
- public class Ship : ModuleBase
+ public class Ship : GeekbotCommandBase
{
- private readonly IErrorHandler _errorHandler;
private readonly IRandomNumberGenerator _randomNumberGenerator;
- private readonly ITranslationHandler _translation;
private readonly DatabaseContext _database;
- public Ship(DatabaseContext database, IErrorHandler errorHandler, IRandomNumberGenerator randomNumberGenerator, ITranslationHandler translation)
+ public Ship(DatabaseContext database, IErrorHandler errorHandler, IRandomNumberGenerator randomNumberGenerator, ITranslationHandler translations) : base(errorHandler, translations)
{
_database = database;
- _errorHandler = errorHandler;
_randomNumberGenerator = randomNumberGenerator;
- _translation = translation;
}
[Command("Ship", RunMode = RunMode.Async)]
@@ -58,28 +55,26 @@ namespace Geekbot.Bot.Commands.Randomness
shippingRate = dbval.Strength;
}
- var transContext = await _translation.GetGuildContext(Context);
-
- var reply = $":heartpulse: **{transContext.GetString("Matchmaking")}** :heartpulse:\r\n";
+ var reply = $":heartpulse: **{Localization.Ship.Matchmaking}** :heartpulse:\r\n";
reply += $":two_hearts: {user1.Mention} :heart: {user2.Mention} :two_hearts:\r\n";
- reply += $"0% [{BlockCounter(shippingRate)}] 100% - {DeterminateSuccess(shippingRate, transContext)}";
+ reply += $"0% [{BlockCounter(shippingRate)}] 100% - {DeterminateSuccess(shippingRate)}";
await ReplyAsync(reply);
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
- private string DeterminateSuccess(int rate, TranslationGuildContext transContext)
+ private string DeterminateSuccess(int rate)
{
return (rate / 20) switch
{
- 0 => transContext.GetString("NotGonnaToHappen"),
- 1 => transContext.GetString("NotSuchAGoodIdea"),
- 2 => transContext.GetString("ThereMightBeAChance"),
- 3 => transContext.GetString("CouldWork"),
- 4 => transContext.GetString("ItsAMatch"),
+ 0 => Localization.Ship.NotGoingToHappen,
+ 1 => Localization.Ship.NotSuchAGoodIdea,
+ 2 => Localization.Ship.ThereMightBeAChance,
+ 3 => Localization.Ship.CouldWork,
+ 4 => Localization.Ship.ItsAMatch,
_ => "nope"
};
}
diff --git a/src/Bot/Commands/Rpg/Cookies.cs b/src/Bot/Commands/Rpg/Cookies.cs
index f581105..570f08a 100644
--- a/src/Bot/Commands/Rpg/Cookies.cs
+++ b/src/Bot/Commands/Rpg/Cookies.cs
@@ -3,6 +3,7 @@ using System.Linq;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
+using Geekbot.Core;
using Geekbot.Core.CommandPreconditions;
using Geekbot.Core.Database;
using Geekbot.Core.Database.Models;
@@ -16,18 +17,14 @@ namespace Geekbot.Bot.Commands.Rpg
[DisableInDirectMessage]
[Group("cookies")]
[Alias("cookie")]
- public class Cookies : ModuleBase
+ public class Cookies : GeekbotCommandBase
{
private readonly DatabaseContext _database;
- private readonly IErrorHandler _errorHandler;
- private readonly ITranslationHandler _translation;
private readonly IRandomNumberGenerator _randomNumberGenerator;
- public Cookies(DatabaseContext database, IErrorHandler errorHandler, ITranslationHandler translation , IRandomNumberGenerator randomNumberGenerator)
+ public Cookies(DatabaseContext database, IErrorHandler errorHandler, ITranslationHandler translations , IRandomNumberGenerator randomNumberGenerator) : base(errorHandler, translations)
{
_database = database;
- _errorHandler = errorHandler;
- _translation = translation;
_randomNumberGenerator = randomNumberGenerator;
}
@@ -37,23 +34,23 @@ namespace Geekbot.Bot.Commands.Rpg
{
try
{
- var transContext = await _translation.GetGuildContext(Context);
+ var transContext = await Translations.GetGuildContext(Context);
var actor = await GetUser(Context.User.Id);
if (actor.LastPayout.Value.AddDays(1).Date > DateTime.Now.Date)
{
var formatedWaitTime = transContext.FormatDateTimeAsRemaining(DateTimeOffset.Now.AddDays(1).Date);
- await ReplyAsync(transContext.GetString("WaitForMoreCookies", formatedWaitTime));
+ await ReplyAsync(string.Format(Localization.Cookies.WaitForMoreCookies, formatedWaitTime));
return;
}
actor.Cookies += 10;
actor.LastPayout = DateTimeOffset.Now;
await SetUser(actor);
- await ReplyAsync(transContext.GetString("GetCookies", 10, actor.Cookies));
+ await ReplyAsync(string.Format(Localization.Cookies.GetCookies, 10, actor.Cookies));
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -63,13 +60,12 @@ namespace Geekbot.Bot.Commands.Rpg
{
try
{
- var transContext = await _translation.GetGuildContext(Context);
var actor = await GetUser(Context.User.Id);
- await ReplyAsync(transContext.GetString("InYourJar", actor.Cookies));
+ await ReplyAsync(string.Format(Localization.Cookies.InYourJar, actor.Cookies));
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -79,12 +75,11 @@ namespace Geekbot.Bot.Commands.Rpg
{
try
{
- var transContext = await _translation.GetGuildContext(Context);
var giver = await GetUser(Context.User.Id);
if (giver.Cookies < amount)
{
- await ReplyAsync(transContext.GetString("NotEnoughToGive"));
+ await ReplyAsync(Localization.Cookies.NotEnoughToGive);
return;
}
@@ -96,11 +91,11 @@ namespace Geekbot.Bot.Commands.Rpg
await SetUser(giver);
await SetUser(taker);
- await ReplyAsync(transContext.GetString("Given", amount, user.Username));
+ await ReplyAsync(string.Format(Localization.Cookies.Given, amount, user.Username));
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -110,12 +105,11 @@ namespace Geekbot.Bot.Commands.Rpg
{
try
{
- var transContext = await _translation.GetGuildContext(Context);
var actor = await GetUser(Context.User.Id);
if (actor.Cookies < 5)
{
- await ReplyAsync(transContext.GetString("NotEnoughCookiesToEat"));
+ await ReplyAsync(Localization.Cookies.NotEnoughCookiesToEat);
return;
}
@@ -124,14 +118,14 @@ namespace Geekbot.Bot.Commands.Rpg
await SetUser(actor);
- await ReplyAsync(transContext.GetString("AteCookies", amount, actor.Cookies));
+ await ReplyAsync(string.Format(Localization.Cookies.AteCookies, amount, actor.Cookies));
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
-
+
private async Task GetUser(ulong userId)
{
var user = _database.Cookies.FirstOrDefault(u =>u.GuildId.Equals(Context.Guild.Id.AsLong()) && u.UserId.Equals(userId.AsLong())) ?? await CreateNewRow(userId);
diff --git a/src/Bot/Commands/User/Karma.cs b/src/Bot/Commands/User/Karma.cs
index 3efc381..41a401c 100644
--- a/src/Bot/Commands/User/Karma.cs
+++ b/src/Bot/Commands/User/Karma.cs
@@ -1,8 +1,11 @@
using System;
+using System.Globalization;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
+using Geekbot.Core;
using Geekbot.Core.CommandPreconditions;
using Geekbot.Core.Database;
using Geekbot.Core.Database.Models;
@@ -13,17 +16,15 @@ using Geekbot.Core.Localization;
namespace Geekbot.Bot.Commands.User
{
[DisableInDirectMessage]
- public class Karma : ModuleBase
+ public class Karma : GeekbotCommandBase
{
- private readonly IErrorHandler _errorHandler;
private readonly DatabaseContext _database;
- private readonly ITranslationHandler _translation;
+ private readonly ITranslationHandler _translations;
- public Karma(DatabaseContext database, IErrorHandler errorHandler, ITranslationHandler translation)
+ public Karma(DatabaseContext database, IErrorHandler errorHandler, ITranslationHandler translations) : base(errorHandler, translations)
{
_database = database;
- _errorHandler = errorHandler;
- _translation = translation;
+ _translations = translations;
}
[Command("good", RunMode = RunMode.Async)]
@@ -32,16 +33,17 @@ namespace Geekbot.Bot.Commands.User
{
try
{
- var transContext = await _translation.GetGuildContext(Context);
+ var transContext = await _translations.GetGuildContext(Context);
+
var actor = await GetUser(Context.User.Id);
if (user.Id == Context.User.Id)
{
- await ReplyAsync(transContext.GetString("CannotChangeOwn", Context.User.Username));
+ await ReplyAsync(string.Format(Localization.Karma.CannotChangeOwnUp, Context.User.Username));
}
else if (TimeoutFinished(actor.TimeOut))
{
var formatedWaitTime = transContext.FormatDateTimeAsRemaining(actor.TimeOut.AddMinutes(3));
- await ReplyAsync(transContext.GetString("WaitUntill", Context.User.Username, formatedWaitTime));
+ await ReplyAsync(string.Format(Localization.Karma.WaitUntill, Context.User.Username, formatedWaitTime));
}
else
{
@@ -60,16 +62,16 @@ namespace Geekbot.Bot.Commands.User
.WithName(user.Username));
eb.WithColor(new Color(138, 219, 146));
- eb.Title = transContext.GetString("Increased");
- eb.AddInlineField(transContext.GetString("By"), Context.User.Username);
- eb.AddInlineField(transContext.GetString("Amount"), "+1");
- eb.AddInlineField(transContext.GetString("Current"), target.Karma);
+ eb.Title = Localization.Karma.Increased;
+ eb.AddInlineField(Localization.Karma.By, Context.User.Username);
+ eb.AddInlineField(Localization.Karma.Amount, "+1");
+ eb.AddInlineField(Localization.Karma.Current, target.Karma);
await ReplyAsync("", false, eb.Build());
}
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -79,16 +81,17 @@ namespace Geekbot.Bot.Commands.User
{
try
{
- var transContext = await _translation.GetGuildContext(Context);
+ var transContext = await _translations.GetGuildContext(Context);
+
var actor = await GetUser(Context.User.Id);
if (user.Id == Context.User.Id)
{
- await ReplyAsync(transContext.GetString("CannotChangeOwn", Context.User.Username));
+ await ReplyAsync(string.Format(Localization.Karma.CannotChangeOwnDown, Context.User.Username));
}
else if (TimeoutFinished(actor.TimeOut))
{
var formatedWaitTime = transContext.FormatDateTimeAsRemaining(actor.TimeOut.AddMinutes(3));
- await ReplyAsync(transContext.GetString("WaitUntill", Context.User.Username, formatedWaitTime));
+ await ReplyAsync(string.Format(Localization.Karma.WaitUntill, Context.User.Username, formatedWaitTime));
}
else
{
@@ -107,16 +110,16 @@ namespace Geekbot.Bot.Commands.User
.WithName(user.Username));
eb.WithColor(new Color(138, 219, 146));
- eb.Title = transContext.GetString("Decreased");
- eb.AddInlineField(transContext.GetString("By"), Context.User.Username);
- eb.AddInlineField(transContext.GetString("Amount"), "-1");
- eb.AddInlineField(transContext.GetString("Current"), target.Karma);
+ eb.Title = Localization.Karma.Decreased;
+ eb.AddInlineField(Localization.Karma.By, Context.User.Username);
+ eb.AddInlineField(Localization.Karma.Amount, "-1");
+ eb.AddInlineField(Localization.Karma.Current, target.Karma);
await ReplyAsync("", false, eb.Build());
}
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
diff --git a/src/Bot/Commands/User/Ranking/Rank.cs b/src/Bot/Commands/User/Ranking/Rank.cs
index ae1bec9..d73aacc 100644
--- a/src/Bot/Commands/User/Ranking/Rank.cs
+++ b/src/Bot/Commands/User/Ranking/Rank.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Discord.Commands;
+using Geekbot.Core;
using Geekbot.Core.CommandPreconditions;
using Geekbot.Core.Converters;
using Geekbot.Core.Database;
@@ -11,28 +12,20 @@ using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Extensions;
using Geekbot.Core.Highscores;
using Geekbot.Core.Localization;
-using Geekbot.Core.UserRepository;
namespace Geekbot.Bot.Commands.User.Ranking
{
- public class Rank : ModuleBase
+ public class Rank : GeekbotCommandBase
{
private readonly IEmojiConverter _emojiConverter;
private readonly IHighscoreManager _highscoreManager;
- private readonly ITranslationHandler _translationHandler;
- private readonly IErrorHandler _errorHandler;
private readonly DatabaseContext _database;
- private readonly IUserRepository _userRepository;
- public Rank(DatabaseContext database, IErrorHandler errorHandler, IUserRepository userRepository,
- IEmojiConverter emojiConverter, IHighscoreManager highscoreManager, ITranslationHandler translationHandler)
+ public Rank(DatabaseContext database, IErrorHandler errorHandler, IEmojiConverter emojiConverter, IHighscoreManager highscoreManager, ITranslationHandler translations): base(errorHandler, translations)
{
_database = database;
- _errorHandler = errorHandler;
- _userRepository = userRepository;
_emojiConverter = emojiConverter;
_highscoreManager = highscoreManager;
- _translationHandler = translationHandler;
}
[Command("rank", RunMode = RunMode.Async)]
@@ -42,7 +35,6 @@ namespace Geekbot.Bot.Commands.User.Ranking
{
try
{
- var transContext = await _translationHandler.GetGuildContext(Context);
HighscoreTypes type;
try
{
@@ -51,14 +43,14 @@ namespace Geekbot.Bot.Commands.User.Ranking
}
catch
{
- await ReplyAsync(transContext.GetString("InvalidType"));
+ await ReplyAsync(Localization.Rank.InvalidType);
return;
}
var replyBuilder = new StringBuilder();
if (amount > 20)
{
- await ReplyAsync(transContext.GetString("LimitingTo20Warning"));
+ await ReplyAsync(Localization.Rank.LimitingTo20Warning);
amount = 20;
}
@@ -70,7 +62,7 @@ namespace Geekbot.Bot.Commands.User.Ranking
}
catch (HighscoreListEmptyException)
{
- await ReplyAsync(transContext.GetString("NoTypeFoundForServer", type));
+ await ReplyAsync(string.Format(Localization.Rank.NoTypeFoundForServer, type));
return;
}
@@ -85,22 +77,24 @@ namespace Geekbot.Bot.Commands.User.Ranking
var failedToRetrieveUser = highscoreUsers.Any(e => string.IsNullOrEmpty(e.Key.Username));
- if (failedToRetrieveUser) replyBuilder.AppendLine(transContext.GetString("FailedToResolveAllUsernames"));
- replyBuilder.AppendLine(transContext.GetString("HighscoresFor", type.ToString().CapitalizeFirst(), Context.Guild.Name));
+ if (failedToRetrieveUser) replyBuilder.AppendLine(Localization.Rank.FailedToResolveAllUsernames).AppendLine();
+
+ replyBuilder.AppendLine(string.Format(Localization.Rank.HighscoresFor, type.ToString().CapitalizeFirst(), Context.Guild.Name));
+
var highscorePlace = 1;
- foreach (var user in highscoreUsers)
+ foreach (var (user, value) in highscoreUsers)
{
replyBuilder.Append(highscorePlace < 11
? $"{_emojiConverter.NumberToEmoji(highscorePlace)} "
: $"`{highscorePlace}.` ");
- replyBuilder.Append(user.Key.Username != null
- ? $"**{user.Key.Username}#{user.Key.Discriminator}**"
- : $"**{user.Key.Id}**");
+ replyBuilder.Append(user.Username != null
+ ? $"**{user.Username}#{user.Discriminator}**"
+ : $"**{user.Id}**");
replyBuilder.Append(type == HighscoreTypes.messages
- ? $" - {user.Value} {type} - {Math.Round((double) (100 * user.Value) / guildMessages, 2)}%\n"
- : $" - {user.Value} {type}\n");
+ ? $" - {value} {type} - {Math.Round((double) (100 * value) / guildMessages, 2)}%\n"
+ : $" - {value} {type}\n");
highscorePlace++;
}
@@ -109,7 +103,7 @@ namespace Geekbot.Bot.Commands.User.Ranking
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
}
diff --git a/src/Bot/Commands/Utils/Choose.cs b/src/Bot/Commands/Utils/Choose.cs
index d245bd2..ea239d7 100644
--- a/src/Bot/Commands/Utils/Choose.cs
+++ b/src/Bot/Commands/Utils/Choose.cs
@@ -1,20 +1,16 @@
using System;
using System.Threading.Tasks;
using Discord.Commands;
+using Geekbot.Core;
using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Localization;
namespace Geekbot.Bot.Commands.Utils
{
- public class Choose : ModuleBase
+ public class Choose : GeekbotCommandBase
{
- private readonly IErrorHandler _errorHandler;
- private readonly ITranslationHandler _translation;
-
- public Choose(IErrorHandler errorHandler, ITranslationHandler translation)
+ public Choose(IErrorHandler errorHandler, ITranslationHandler translation) : base(errorHandler, translation)
{
- _errorHandler = errorHandler;
- _translation = translation;
}
[Command("choose", RunMode = RunMode.Async)]
@@ -24,14 +20,13 @@ namespace Geekbot.Bot.Commands.Utils
{
try
{
- var transContext = await _translation.GetGuildContext(Context);
var choicesArray = choices.Split(';');
var choice = new Random().Next(choicesArray.Length);
- await ReplyAsync(transContext.GetString("Choice", choicesArray[choice].Trim()));
+ await ReplyAsync(string.Format(Localization.Choose.Choice, choicesArray[choice].Trim()));
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
}
diff --git a/src/Bot/Commands/Utils/Quote/Quote.cs b/src/Bot/Commands/Utils/Quote/Quote.cs
index a731273..5bb23a9 100644
--- a/src/Bot/Commands/Utils/Quote/Quote.cs
+++ b/src/Bot/Commands/Utils/Quote/Quote.cs
@@ -17,20 +17,16 @@ namespace Geekbot.Bot.Commands.Utils.Quote
{
[Group("quote")]
[DisableInDirectMessage]
- public class Quote : ModuleBase
+ public class Quote : GeekbotCommandBase
{
- private readonly IErrorHandler _errorHandler;
private readonly DatabaseContext _database;
private readonly IRandomNumberGenerator _randomNumberGenerator;
- private readonly ITranslationHandler _translationHandler;
private readonly bool _isDev;
- public Quote(IErrorHandler errorHandler, DatabaseContext database, IRandomNumberGenerator randomNumberGenerator, ITranslationHandler translationHandler)
+ public Quote(IErrorHandler errorHandler, DatabaseContext database, IRandomNumberGenerator randomNumberGenerator, ITranslationHandler translationHandler) : base(errorHandler, translationHandler)
{
- _errorHandler = errorHandler;
_database = database;
_randomNumberGenerator = randomNumberGenerator;
- _translationHandler = translationHandler;
// to remove restrictions when developing
_isDev = Constants.BotVersion() == "0.0.0-DEV";
}
@@ -45,8 +41,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
if (!s.Any())
{
- var transContext = await _translationHandler.GetGuildContext(Context);
- await ReplyAsync(transContext.GetString("NoQuotesFound"));
+ await ReplyAsync(Localization.Quote.NoQuotesFound);
return;
}
@@ -58,7 +53,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context, "Whoops, seems like the quote was to edgy to return");
+ await ErrorHandler.HandleCommandException(e, Context, "Whoops, seems like the quote was to edgy to return");
}
}
@@ -117,23 +112,22 @@ namespace Geekbot.Bot.Commands.Utils.Quote
{
try
{
- var transContext = await _translationHandler.GetGuildContext(Context);
var quote = _database.Quotes.Where(e => e.GuildId == Context.Guild.Id.AsLong() && e.InternalId == id)?.FirstOrDefault();
if (quote != null)
{
_database.Quotes.Remove(quote);
await _database.SaveChangesAsync();
var embed = QuoteBuilder(quote);
- await ReplyAsync(transContext.GetString("Removed", id), false, embed.Build());
+ await ReplyAsync(string.Format(Localization.Quote.Removed, id), false, embed.Build());
}
else
{
- await ReplyAsync(transContext.GetString("NotFoundWithId"));
+ await ReplyAsync(Localization.Quote.NotFoundWithId);
}
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context, "I couldn't find a quote with that id :disappointed:");
+ await ErrorHandler.HandleCommandException(e, Context, "I couldn't find a quote with that id :disappointed:");
}
}
@@ -144,12 +138,11 @@ namespace Geekbot.Bot.Commands.Utils.Quote
try
{
// setup
- var transContext = await _translationHandler.GetGuildContext(Context);
var eb = new EmbedBuilder();
eb.Author = new EmbedAuthorBuilder()
{
IconUrl = Context.Guild.IconUrl,
- Name = $"{Context.Guild.Name} - {transContext.GetString("QuoteStats")}"
+ Name = $"{Context.Guild.Name} - {Localization.Quote.QuoteStats}"
};
// gather data
@@ -157,7 +150,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
if (totalQuotes == 0)
{
// no quotes, no stats, end of the road
- await ReplyAsync(transContext.GetString("NoQuotesFound"));
+ await ReplyAsync(Localization.Quote.NoQuotesFound);
return;
}
@@ -176,8 +169,8 @@ namespace Geekbot.Bot.Commands.Utils.Quote
.OrderBy(row => row.year);
// add data to the embed
- eb.AddField(transContext.GetString("MostQuotesPerson"), $"{mostQuotedPersonUser.Username} ({mostQuotedPerson.amount})");
- eb.AddInlineField(transContext.GetString("TotalQuotes"), totalQuotes);
+ eb.AddField(Localization.Quote.MostQuotesPerson, $"{mostQuotedPersonUser.Username} ({mostQuotedPerson.amount})");
+ eb.AddInlineField(Localization.Quote.TotalQuotes, totalQuotes);
foreach (var year in quotesByYear)
{
@@ -188,7 +181,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context);
+ await ErrorHandler.HandleCommandException(e, Context);
}
}
@@ -196,8 +189,6 @@ namespace Geekbot.Bot.Commands.Utils.Quote
{
try
{
- var transContext = await _translationHandler.GetGuildContext(Context);
-
var list = Context.Channel.GetMessagesAsync().Flatten();
var message = await list.FirstOrDefaultAsync(msg =>
msg.Author.Id == user.Id &&
@@ -206,11 +197,11 @@ namespace Geekbot.Bot.Commands.Utils.Quote
!msg.Content.ToLower().StartsWith("!"));
if (message == null) return;
- await ProcessQuote(message, saveToDb, transContext);
+ await ProcessQuote(message, saveToDb);
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context, $"No quoteable messages have been sent by {user.Username} in this channel");
+ await ErrorHandler.HandleCommandException(e, Context, $"No quoteable messages have been sent by {user.Username} in this channel");
}
}
@@ -219,14 +210,14 @@ namespace Geekbot.Bot.Commands.Utils.Quote
{
try
{
- var transContext = await _translationHandler.GetGuildContext(Context);
+ // var transContext = await _translationHandler.GetGuildContext(Context);
var message = await Context.Channel.GetMessageAsync(messageId);
- await ProcessQuote(message, saveToDb, transContext);
+ await ProcessQuote(message, saveToDb);
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context, "I couldn't find a message with that id :disappointed:");
+ await ErrorHandler.HandleCommandException(e, Context, "I couldn't find a message with that id :disappointed:");
}
}
@@ -234,18 +225,18 @@ namespace Geekbot.Bot.Commands.Utils.Quote
{
try
{
- var transContext = await _translationHandler.GetGuildContext(Context);
+ // var transContext = await _translationHandler.GetGuildContext(Context);
if (!MessageLink.IsValid(messageLink))
{
- await ReplyAsync(transContext.GetString("NotAValidMessageLink"));
+ await ReplyAsync(Localization.Quote.NotAValidMessageLink);
return;
}
var link = new MessageLink(messageLink);
if (link.GuildId != Context.Guild.Id)
{
- await ReplyAsync(transContext.GetString("OnlyQuoteFromSameServer"));
+ await ReplyAsync(Localization.Quote.OnlyQuoteFromSameServer);
return;
}
@@ -255,25 +246,25 @@ namespace Geekbot.Bot.Commands.Utils.Quote
var message = await channel.GetMessageAsync(link.MessageId);
- await ProcessQuote(message, saveToDb, transContext);
+ await ProcessQuote(message, saveToDb);
}
catch (Exception e)
{
- await _errorHandler.HandleCommandException(e, Context, "I couldn't find that message :disappointed:");
+ await ErrorHandler.HandleCommandException(e, Context, "I couldn't find that message :disappointed:");
}
}
- private async Task ProcessQuote(IMessage message, bool saveToDb, TranslationGuildContext transContext)
+ private async Task ProcessQuote(IMessage message, bool saveToDb)
{
if (message.Author.Id == Context.Message.Author.Id && saveToDb && !_isDev)
{
- await ReplyAsync(transContext.GetString("CannotSaveOwnQuotes"));
+ await ReplyAsync(Localization.Quote.CannotSaveOwnQuotes);
return;
}
if (message.Author.IsBot && saveToDb && !_isDev)
{
- await ReplyAsync(transContext.GetString("CannotQuoteBots"));
+ await ReplyAsync(Localization.Quote.CannotQuoteBots);
return;
}
@@ -285,7 +276,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
}
var embed = QuoteBuilder(quote);
- await ReplyAsync(saveToDb ? transContext.GetString("QuoteAdded") : string.Empty, false, embed.Build());
+ await ReplyAsync(saveToDb ? Localization.Quote.QuoteAdded : string.Empty, false, embed.Build());
}
private EmbedBuilder QuoteBuilder(QuoteModel quote)
diff --git a/src/Bot/Localization/Admin.Designer.cs b/src/Bot/Localization/Admin.Designer.cs
new file mode 100644
index 0000000..c55adf1
--- /dev/null
+++ b/src/Bot/Localization/Admin.Designer.cs
@@ -0,0 +1,81 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Geekbot.Bot.Localization {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Admin {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Admin() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Admin", typeof(Admin).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to I'm talking english.
+ ///
+ internal static string GetLanguage {
+ get {
+ return ResourceManager.GetString("GetLanguage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to I will reply in english from now on.
+ ///
+ internal static string NewLanguageSet {
+ get {
+ return ResourceManager.GetString("NewLanguageSet", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Bot/Localization/Admin.de-ch.resx b/src/Bot/Localization/Admin.de-ch.resx
new file mode 100644
index 0000000..b89939b
--- /dev/null
+++ b/src/Bot/Localization/Admin.de-ch.resx
@@ -0,0 +1,20 @@
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ I werd ab jetzt uf schwiizerdüütsch antworte, äuuä
+
+
+ I red schwiizerdüütsch
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Admin.resx b/src/Bot/Localization/Admin.resx
new file mode 100644
index 0000000..6fd2c62
--- /dev/null
+++ b/src/Bot/Localization/Admin.resx
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ I will reply in english from now on
+
+
+ I'm talking english
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Choose.Designer.cs b/src/Bot/Localization/Choose.Designer.cs
new file mode 100644
index 0000000..1319140
--- /dev/null
+++ b/src/Bot/Localization/Choose.Designer.cs
@@ -0,0 +1,72 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Geekbot.Bot.Localization {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Choose {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Choose() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Choose", typeof(Choose).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to I Choose **{0}**.
+ ///
+ internal static string Choice {
+ get {
+ return ResourceManager.GetString("Choice", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Bot/Localization/Choose.de-ch.resx b/src/Bot/Localization/Choose.de-ch.resx
new file mode 100644
index 0000000..eedc39b
--- /dev/null
+++ b/src/Bot/Localization/Choose.de-ch.resx
@@ -0,0 +1,17 @@
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ I nimme **{0}**
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Choose.resx b/src/Bot/Localization/Choose.resx
new file mode 100644
index 0000000..052177b
--- /dev/null
+++ b/src/Bot/Localization/Choose.resx
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ I Choose **{0}**
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Cookies.Designer.cs b/src/Bot/Localization/Cookies.Designer.cs
new file mode 100644
index 0000000..5f2528f
--- /dev/null
+++ b/src/Bot/Localization/Cookies.Designer.cs
@@ -0,0 +1,126 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Geekbot.Bot.Localization {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Cookies {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Cookies() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Cookies", typeof(Cookies).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You ate {0} cookies, you've only got {1} cookies left.
+ ///
+ internal static string AteCookies {
+ get {
+ return ResourceManager.GetString("AteCookies", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You got {0} cookies, there are now {1} cookies in you cookie jar.
+ ///
+ internal static string GetCookies {
+ get {
+ return ResourceManager.GetString("GetCookies", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You gave {0} cookies to {1}.
+ ///
+ internal static string Given {
+ get {
+ return ResourceManager.GetString("Given", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to There are {0} cookies in you cookie jar.
+ ///
+ internal static string InYourJar {
+ get {
+ return ResourceManager.GetString("InYourJar", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Your cookie jar looks almost empty, you should probably not eat a cookie.
+ ///
+ internal static string NotEnoughCookiesToEat {
+ get {
+ return ResourceManager.GetString("NotEnoughCookiesToEat", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You don't have enough cookies.
+ ///
+ internal static string NotEnoughToGive {
+ get {
+ return ResourceManager.GetString("NotEnoughToGive", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You already got cookies today, you can have more cookies in {0}.
+ ///
+ internal static string WaitForMoreCookies {
+ get {
+ return ResourceManager.GetString("WaitForMoreCookies", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Bot/Localization/Cookies.de-ch.resx b/src/Bot/Localization/Cookies.de-ch.resx
new file mode 100644
index 0000000..b53b588
--- /dev/null
+++ b/src/Bot/Localization/Cookies.de-ch.resx
@@ -0,0 +1,35 @@
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Du häsch {0} guetzli becho, du häsch jetzt {1} guetzli ih dr büchse
+
+
+ Du hesch scho guetzli becho hüt, du chasch meh ha in {0}
+
+
+ Es hät {0} guetzli ih dineri büchs
+
+
+ Du hesch {1} {0} guetzli geh
+
+
+ Du hesch nid gnueg guetzli
+
+
+ Du hesch chuum no guetzli ih dineri büchs, du sötsch warschinli keini esse
+
+
+ Du hesch {0} guetzli gesse und hesch jezt no {1} übrig
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Cookies.resx b/src/Bot/Localization/Cookies.resx
new file mode 100644
index 0000000..53207fa
--- /dev/null
+++ b/src/Bot/Localization/Cookies.resx
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ You got {0} cookies, there are now {1} cookies in you cookie jar
+
+
+ You already got cookies today, you can have more cookies in {0}
+
+
+ There are {0} cookies in you cookie jar
+
+
+ You gave {0} cookies to {1}
+
+
+ You don't have enough cookies
+
+
+ Your cookie jar looks almost empty, you should probably not eat a cookie
+
+
+ You ate {0} cookies, you've only got {1} cookies left
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Internal.Designer.cs b/src/Bot/Localization/Internal.Designer.cs
new file mode 100644
index 0000000..e7c18af
--- /dev/null
+++ b/src/Bot/Localization/Internal.Designer.cs
@@ -0,0 +1,126 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Geekbot.Bot.Localization {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Internal {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Internal() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Internal", typeof(Internal).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to and.
+ ///
+ internal static string And {
+ get {
+ return ResourceManager.GetString("And", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to day|days.
+ ///
+ internal static string Days {
+ get {
+ return ResourceManager.GetString("Days", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to hour|hours.
+ ///
+ internal static string Hours {
+ get {
+ return ResourceManager.GetString("Hours", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Seems like i don't have enough permission to that :confused:.
+ ///
+ internal static string Http403 {
+ get {
+ return ResourceManager.GetString("Http403", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to minute|minutes.
+ ///
+ internal static string Minutes {
+ get {
+ return ResourceManager.GetString("Minutes", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to second|seconds.
+ ///
+ internal static string Seconds {
+ get {
+ return ResourceManager.GetString("Seconds", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Something went wrong :confused:.
+ ///
+ internal static string SomethingWentWrong {
+ get {
+ return ResourceManager.GetString("SomethingWentWrong", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Bot/Localization/Internal.de-ch.resx b/src/Bot/Localization/Internal.de-ch.resx
new file mode 100644
index 0000000..568bb1f
--- /dev/null
+++ b/src/Bot/Localization/Internal.de-ch.resx
@@ -0,0 +1,35 @@
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Öppis isch schief gange :confused:
+
+
+ Gseht danach us das ich nid gnueg recht han zum das mache :confused:
+
+
+ tag|täg
+
+
+ stund|stunde
+
+
+ minute|minute
+
+
+ sekunde|sekunde
+
+
+ und
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Internal.resx b/src/Bot/Localization/Internal.resx
new file mode 100644
index 0000000..a771d6b
--- /dev/null
+++ b/src/Bot/Localization/Internal.resx
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Something went wrong :confused:
+
+
+ Seems like i don't have enough permission to that :confused:
+
+
+ day|days
+
+
+ hour|hours
+
+
+ minute|minutes
+
+
+ second|seconds
+
+
+ and
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Karma.Designer.cs b/src/Bot/Localization/Karma.Designer.cs
new file mode 100644
index 0000000..4191fa2
--- /dev/null
+++ b/src/Bot/Localization/Karma.Designer.cs
@@ -0,0 +1,135 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Geekbot.Bot.Localization {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Karma {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Karma() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Karma", typeof(Karma).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Amount.
+ ///
+ internal static string Amount {
+ get {
+ return ResourceManager.GetString("Amount", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to By.
+ ///
+ internal static string By {
+ get {
+ return ResourceManager.GetString("By", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Sorry {0}, but you can't lower your own karma.
+ ///
+ internal static string CannotChangeOwnDown {
+ get {
+ return ResourceManager.GetString("CannotChangeOwnDown", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Sorry {0}, but you can't give yourself karma.
+ ///
+ internal static string CannotChangeOwnUp {
+ get {
+ return ResourceManager.GetString("CannotChangeOwnUp", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Current.
+ ///
+ internal static string Current {
+ get {
+ return ResourceManager.GetString("Current", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Karma lowered.
+ ///
+ internal static string Decreased {
+ get {
+ return ResourceManager.GetString("Decreased", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Gained Karma.
+ ///
+ internal static string Increased {
+ get {
+ return ResourceManager.GetString("Increased", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Sorry {0}, but you have to wait {1} before you can give karma again....
+ ///
+ internal static string WaitUntill {
+ get {
+ return ResourceManager.GetString("WaitUntill", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Bot/Localization/Karma.de-ch.resx b/src/Bot/Localization/Karma.de-ch.resx
new file mode 100644
index 0000000..294c105
--- /dev/null
+++ b/src/Bot/Localization/Karma.de-ch.resx
@@ -0,0 +1,38 @@
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Sorry {0}, aber du chasch dr selber kei karma geh
+
+
+ Sorry {0}, aber du musch no {1} warte bisch d wieder karma chasch geh...
+
+
+ Karma becho
+
+
+ Vo
+
+
+ Mengi
+
+
+ Jetzt
+
+
+ Sorry {0}, aber du chasch dr din eigete karma nid weg neh
+
+
+ Karma gsenkt
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Karma.resx b/src/Bot/Localization/Karma.resx
new file mode 100644
index 0000000..3a8fe5a
--- /dev/null
+++ b/src/Bot/Localization/Karma.resx
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Sorry {0}, but you can't give yourself karma
+
+
+ Sorry {0}, but you have to wait {1} before you can give karma again...
+
+
+ Gained Karma
+
+
+ By
+
+
+ Amount
+
+
+ Current
+
+
+ Sorry {0}, but you can't lower your own karma
+
+
+ Karma lowered
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Quote.Designer.cs b/src/Bot/Localization/Quote.Designer.cs
new file mode 100644
index 0000000..342c181
--- /dev/null
+++ b/src/Bot/Localization/Quote.Designer.cs
@@ -0,0 +1,162 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Geekbot.Bot.Localization {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Quote {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Quote() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Quote", typeof(Quote).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You can't save quotes by a bot....
+ ///
+ internal static string CannotQuoteBots {
+ get {
+ return ResourceManager.GetString("CannotQuoteBots", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You can't save your own quotes....
+ ///
+ internal static string CannotSaveOwnQuotes {
+ get {
+ return ResourceManager.GetString("CannotSaveOwnQuotes", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Most quoted person.
+ ///
+ internal static string MostQuotesPerson {
+ get {
+ return ResourceManager.GetString("MostQuotesPerson", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to This server doesn't seem to have any quotes yet. You can add a quote with `!quote save @user` or `!quote save <messageId>`.
+ ///
+ internal static string NoQuotesFound {
+ get {
+ return ResourceManager.GetString("NoQuotesFound", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to That is not a valid message link.
+ ///
+ internal static string NotAValidMessageLink {
+ get {
+ return ResourceManager.GetString("NotAValidMessageLink", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to I couldn't find a quote with that ID :disappointed:.
+ ///
+ internal static string NotFoundWithId {
+ get {
+ return ResourceManager.GetString("NotFoundWithId", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You can only quote messages from the same server.
+ ///
+ internal static string OnlyQuoteFromSameServer {
+ get {
+ return ResourceManager.GetString("OnlyQuoteFromSameServer", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to **Quote Added**.
+ ///
+ internal static string QuoteAdded {
+ get {
+ return ResourceManager.GetString("QuoteAdded", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Quote Stats.
+ ///
+ internal static string QuoteStats {
+ get {
+ return ResourceManager.GetString("QuoteStats", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to **Removed #{0}**.
+ ///
+ internal static string Removed {
+ get {
+ return ResourceManager.GetString("Removed", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Total.
+ ///
+ internal static string TotalQuotes {
+ get {
+ return ResourceManager.GetString("TotalQuotes", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Bot/Localization/Quote.de-ch.resx b/src/Bot/Localization/Quote.de-ch.resx
new file mode 100644
index 0000000..99fd959
--- /dev/null
+++ b/src/Bot/Localization/Quote.de-ch.resx
@@ -0,0 +1,47 @@
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Dä server het no kei quotes. Du chasch quotes hinzuefüege mit `!quote save @user` oder `!quote save <messageId>`
+
+
+ Du chasch kei quotes vo dir selber speichere...
+
+
+ Du chasch kei quotes vomne bot speichere...
+
+
+ **Quote hinzugfüegt**
+
+
+ **#{0} glöscht**
+
+
+ Ich chan kei quote finde mit därri ID :disappointed:
+
+
+ Quote statistike
+
+
+ Total
+
+
+ Meist quoteti person
+
+
+ Das isch kei korrete nachrichtelink
+
+
+ Du chasch numme nachrichte vom gliche server quote
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Quote.resx b/src/Bot/Localization/Quote.resx
new file mode 100644
index 0000000..b51d79c
--- /dev/null
+++ b/src/Bot/Localization/Quote.resx
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ This server doesn't seem to have any quotes yet. You can add a quote with `!quote save @user` or `!quote save <messageId>`
+
+
+ You can't save your own quotes...
+
+
+ You can't save quotes by a bot...
+
+
+ **Quote Added**
+
+
+ **Removed #{0}**
+
+
+ I couldn't find a quote with that ID :disappointed:
+
+
+ Quote Stats
+
+
+ Total
+
+
+ Most quoted person
+
+
+ That is not a valid message link
+
+
+ You can only quote messages from the same server
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Rank.Designer.cs b/src/Bot/Localization/Rank.Designer.cs
new file mode 100644
index 0000000..23f5e16
--- /dev/null
+++ b/src/Bot/Localization/Rank.Designer.cs
@@ -0,0 +1,108 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Geekbot.Bot.Localization {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Rank {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Rank() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Rank", typeof(Rank).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to :warning: I couldn't find all usernames. Maybe they left the server?.
+ ///
+ internal static string FailedToResolveAllUsernames {
+ get {
+ return ResourceManager.GetString("FailedToResolveAllUsernames", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to :bar_chart: **{0} Highscore for {1}**.
+ ///
+ internal static string HighscoresFor {
+ get {
+ return ResourceManager.GetString("HighscoresFor", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Valid types are '`messages`' '`karma`', '`rolls`' and '`cookies`'.
+ ///
+ internal static string InvalidType {
+ get {
+ return ResourceManager.GetString("InvalidType", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to :warning: Limiting to 20.
+ ///
+ internal static string LimitingTo20Warning {
+ get {
+ return ResourceManager.GetString("LimitingTo20Warning", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No {0} found on this server.
+ ///
+ internal static string NoTypeFoundForServer {
+ get {
+ return ResourceManager.GetString("NoTypeFoundForServer", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Bot/Localization/Rank.de-ch.resx b/src/Bot/Localization/Rank.de-ch.resx
new file mode 100644
index 0000000..0b22fe4
--- /dev/null
+++ b/src/Bot/Localization/Rank.de-ch.resx
@@ -0,0 +1,29 @@
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ :warning: Limitiert uf 20
+
+
+ Kei {0} gfunde für dä server
+
+
+ :warning: Ich han nid alli benutzername gfunde. villiicht hend sie de server verlah?
+
+
+ :bar_chart: **{0} Highscore für {1}**
+
+
+ Gültigi paramenter sind '`messages`' '`karma`', '`rolls`' und '`cookies`
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Rank.resx b/src/Bot/Localization/Rank.resx
new file mode 100644
index 0000000..9598cf8
--- /dev/null
+++ b/src/Bot/Localization/Rank.resx
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Valid types are '`messages`' '`karma`', '`rolls`' and '`cookies`'
+
+
+ :warning: Limiting to 20
+
+
+ No {0} found on this server
+
+
+ :warning: I couldn't find all usernames. Maybe they left the server?
+
+
+ :bar_chart: **{0} Highscore for {1}**
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Roll.Designer.cs b/src/Bot/Localization/Roll.Designer.cs
new file mode 100644
index 0000000..fda0536
--- /dev/null
+++ b/src/Bot/Localization/Roll.Designer.cs
@@ -0,0 +1,99 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Geekbot.Bot.Localization {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Roll {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Roll() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Roll", typeof(Roll).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Congratulations {0}, your guess was correct!.
+ ///
+ internal static string Gratz {
+ get {
+ return ResourceManager.GetString("Gratz", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to :red_circle: {0}, you can't guess the same number again, guess another number or wait {1}.
+ ///
+ internal static string NoPrevGuess {
+ get {
+ return ResourceManager.GetString("NoPrevGuess", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0}, you rolled {1}, your guess was {2}.
+ ///
+ internal static string Rolled {
+ get {
+ return ResourceManager.GetString("Rolled", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0}, you rolled {1}.
+ ///
+ internal static string RolledNoGuess {
+ get {
+ return ResourceManager.GetString("RolledNoGuess", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Bot/Localization/Roll.de-ch.resx b/src/Bot/Localization/Roll.de-ch.resx
new file mode 100644
index 0000000..ba73316
--- /dev/null
+++ b/src/Bot/Localization/Roll.de-ch.resx
@@ -0,0 +1,26 @@
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ {0}, du hesch {1} grollt und hesch {2} grate
+
+
+ Gratuliere {0}, du hesch richtig grate!
+
+
+ {0}, du hesch {1} grollt
+
+
+ :red_circle: {0}, du chasch nid nomol es gliche rate, rate öppis anders oder warte {1}
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Roll.resx b/src/Bot/Localization/Roll.resx
new file mode 100644
index 0000000..822abb6
--- /dev/null
+++ b/src/Bot/Localization/Roll.resx
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ {0}, you rolled {1}, your guess was {2}
+
+
+ Congratulations {0}, your guess was correct!
+
+
+ {0}, you rolled {1}
+
+
+ :red_circle: {0}, you can't guess the same number again, guess another number or wait {1}
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Ship.Designer.cs b/src/Bot/Localization/Ship.Designer.cs
new file mode 100644
index 0000000..d959693
--- /dev/null
+++ b/src/Bot/Localization/Ship.Designer.cs
@@ -0,0 +1,117 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Geekbot.Bot.Localization {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Ship {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Ship() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Ship", typeof(Ship).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Almost a match.
+ ///
+ internal static string CouldWork {
+ get {
+ return ResourceManager.GetString("CouldWork", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to It's a match.
+ ///
+ internal static string ItsAMatch {
+ get {
+ return ResourceManager.GetString("ItsAMatch", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Matchmaking.
+ ///
+ internal static string Matchmaking {
+ get {
+ return ResourceManager.GetString("Matchmaking", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Not going happen.
+ ///
+ internal static string NotGoingToHappen {
+ get {
+ return ResourceManager.GetString("NotGoingToHappen", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Not such a good idea.
+ ///
+ internal static string NotSuchAGoodIdea {
+ get {
+ return ResourceManager.GetString("NotSuchAGoodIdea", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to There might be a chance.
+ ///
+ internal static string ThereMightBeAChance {
+ get {
+ return ResourceManager.GetString("ThereMightBeAChance", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/Bot/Localization/Ship.de-ch.resx b/src/Bot/Localization/Ship.de-ch.resx
new file mode 100644
index 0000000..ec2880b
--- /dev/null
+++ b/src/Bot/Localization/Ship.de-ch.resx
@@ -0,0 +1,32 @@
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Verkupple
+
+
+ Wird nöd klappe
+
+
+ Nöd so ä gueti idee
+
+
+ Es gid eventuel ä chance
+
+
+ Fasch en match
+
+
+ Es isch es traumpaar
+
+
\ No newline at end of file
diff --git a/src/Bot/Localization/Ship.resx b/src/Bot/Localization/Ship.resx
new file mode 100644
index 0000000..611040f
--- /dev/null
+++ b/src/Bot/Localization/Ship.resx
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Matchmaking
+
+
+ Not going happen
+
+
+ Not such a good idea
+
+
+ There might be a chance
+
+
+ Almost a match
+
+
+ It's a match
+
+
\ No newline at end of file
diff --git a/src/Core/GeekbotCommandBase.cs b/src/Core/GeekbotCommandBase.cs
new file mode 100644
index 0000000..8df5265
--- /dev/null
+++ b/src/Core/GeekbotCommandBase.cs
@@ -0,0 +1,27 @@
+using System.Globalization;
+using System.Threading;
+using Discord.Commands;
+using Geekbot.Core.ErrorHandling;
+using Geekbot.Core.Localization;
+
+namespace Geekbot.Core
+{
+ public class GeekbotCommandBase : ModuleBase
+ {
+ protected readonly IErrorHandler ErrorHandler;
+ protected readonly ITranslationHandler Translations;
+
+ protected GeekbotCommandBase(IErrorHandler errorHandler, ITranslationHandler translations)
+ {
+ ErrorHandler = errorHandler;
+ Translations = translations;
+ }
+
+ protected override void BeforeExecute(CommandInfo command)
+ {
+ base.BeforeExecute(command);
+ var language = Translations.GetServerLanguage(Context.Guild.Id);
+ Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(language == "CHDE" ? "de-ch" : language);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Core/Localization/ITranslationHandler.cs b/src/Core/Localization/ITranslationHandler.cs
index 74b3e88..1cc06fa 100644
--- a/src/Core/Localization/ITranslationHandler.cs
+++ b/src/Core/Localization/ITranslationHandler.cs
@@ -12,5 +12,6 @@ namespace Geekbot.Core.Localization
Task GetGuildContext(ICommandContext context);
Task SetLanguage(ulong guildId, string language);
List SupportedLanguages { get; }
+ string GetServerLanguage(ulong guildId);
}
}
\ No newline at end of file
diff --git a/src/Core/Localization/TranslationHandler.cs b/src/Core/Localization/TranslationHandler.cs
index c7d35e9..1a46ada 100644
--- a/src/Core/Localization/TranslationHandler.cs
+++ b/src/Core/Localization/TranslationHandler.cs
@@ -89,7 +89,7 @@ namespace Geekbot.Core.Localization
}
}
- private Task GetServerLanguage(ulong guildId)
+ public string GetServerLanguage(ulong guildId)
{
try
{
@@ -99,7 +99,7 @@ namespace Geekbot.Core.Localization
lang = _serverLanguages[guildId];
if (!string.IsNullOrEmpty(lang))
{
- return Task.FromResult(lang);
+ return lang;
}
throw new Exception();
}
@@ -107,19 +107,19 @@ namespace Geekbot.Core.Localization
{
lang = _guildSettingsManager.GetSettings(guildId, false)?.Language ?? "EN";
_serverLanguages[guildId] = lang;
- return Task.FromResult(lang);
+ return lang;
}
}
catch (Exception e)
{
_logger.Error(LogSource.Geekbot, "Could not get guild language", e);
- return Task.FromResult("EN");
+ return "EN";
}
}
public async Task GetString(ulong guildId, string command, string stringName)
{
- var serverLang = await GetServerLanguage(guildId);
+ var serverLang = GetServerLanguage(guildId);
return GetString(serverLang, command, stringName);
}
@@ -140,7 +140,7 @@ namespace Geekbot.Core.Localization
try
{
var command = context.Message.Content.Split(' ').First().TrimStart('!').ToLower();
- var serverLanguage = await GetServerLanguage(context.Guild?.Id ?? 0);
+ var serverLanguage = GetServerLanguage(context.Guild?.Id ?? 0);
return _translations[serverLanguage][command];
}
catch (Exception e)
@@ -153,7 +153,7 @@ namespace Geekbot.Core.Localization
public async Task GetGuildContext(ICommandContext context)
{
var dict = await GetDict(context);
- var language = await GetServerLanguage(context.Guild?.Id ?? 0);
+ var language = GetServerLanguage(context.Guild?.Id ?? 0);
return new TranslationGuildContext(this, language, dict);
}
@@ -161,7 +161,7 @@ namespace Geekbot.Core.Localization
{
try
{
- var serverLanguage = await GetServerLanguage(context.Guild?.Id ?? 0);
+ var serverLanguage = GetServerLanguage(context.Guild?.Id ?? 0);
return _translations[serverLanguage][command];
}
catch (Exception e)
diff --git a/src/Core/Localization/Translations.yml b/src/Core/Localization/Translations.yml
index fbb55bf..678755d 100644
--- a/src/Core/Localization/Translations.yml
+++ b/src/Core/Localization/Translations.yml
@@ -15,13 +15,6 @@ dateTime:
And:
EN: "and"
CHDE: "und"
-admin:
- NewLanguageSet:
- EN: "I will reply in english from now on"
- CHDE: "I werd ab jetzt uf schwiizerdüütsch antworte, äuuä"
- GetLanguage:
- EN: "I'm talking english"
- CHDE: "I red schwiizerdüütsch"
errorHandler:
SomethingWentWrong:
EN: "Something went wrong :confused:"
@@ -30,86 +23,6 @@ httpErrors:
403:
EN: "Seems like i don't have enough permission to that :confused:"
CHDE: "Gseht danach us das ich nid gnueg recht han zum das mache :confused:"
-choose:
- Choice:
- EN: "I Choose **{0}**"
- CHDE: "I nimme **{0}**"
-good:
- CannotChangeOwn:
- EN: "Sorry {0}, but you can't give yourself karma"
- CHDE: "Sorry {0}, aber du chasch dr selber kei karma geh"
- WaitUntill:
- EN: "Sorry {0}, but you have to wait {1} before you can give karma again..."
- CHDE: "Sorry {0}, aber du musch no {1} warte bisch d wieder karma chasch geh..."
- Increased:
- EN: "Karma gained"
- CHDE: "Karma becho"
- By:
- EN: "By"
- CHDE: "Vo"
- Amount:
- EN: "Amount"
- CHDE: "Mengi"
- Current:
- EN: "Current"
- CHDE: "Jetzt"
-bad:
- CannotChangeOwn:
- EN: "Sorry {0}, but you can't lower your own karma"
- CHDE: "Sorry {0}, aber du chasch dr din eigete karma nid weg neh"
- WaitUntill:
- EN: "Sorry {0}, but you have to wait {1} before you can lower karma again..."
- CHDE: "Sorry {0}, aber du musch no {1} warte bisch d wieder karma chasch senke..."
- Decreased:
- EN: "Karma lowered"
- CHDE: "Karma gsenkt"
- By:
- EN: "By"
- CHDE: "Vo"
- Amount:
- EN: "Amount"
- CHDE: "Mengi"
- Current:
- EN: "Current"
- CHDE: "Jetzt"
-roll:
- Rolled:
- EN: "{0}, you rolled {1}, your guess was {2}"
- CHDE: "{0}, du hesch {1} grollt und hesch {2} grate"
- Gratz:
- EN: "Congratulations {0}, your guess was correct!"
- CHDE: "Gratuliere {0}, du hesch richtig grate!"
- RolledNoGuess:
- EN: "{0}, you rolled {1}"
- CHDE: "{0}, du hesch {1} grollt"
- NoPrevGuess:
- EN: ":red_circle: {0}, you can't guess the same number again, guess another number or wait {1}"
- CHDE: ":red_circle: {0}, du chasch nid nomol es gliche rate, rate öppis anders oder warte {1}"
-cookies: &cookiesAlias
- GetCookies:
- EN: "You got {0} cookies, there are now {1} cookies in you cookie jar"
- CHDE: "Du häsch {0} guetzli becho, du häsch jetzt {1} guetzli ih dr büchse"
- WaitForMoreCookies:
- EN: "You already got cookies today, you can have more cookies in {0}"
- CHDE: "Du hesch scho guetzli becho hüt, du chasch meh ha in {0}"
- InYourJar:
- EN: "There are {0} cookies in you cookie jar"
- CHDE: "Es hät {0} guetzli ih dineri büchs"
- Given:
- EN: "You gave {0} cookies to {1}"
- CHDE: "Du hesch {1} {0} guetzli geh"
- NotEnoughToGive:
- EN: "You don't have enough cookies"
- CHDE: "Du hesch nid gnueg guetzli"
- NotEnoughCookiesToEat:
- EN: "Your cookie jar looks almost empty, you should probably not eat a cookie"
- CHDE: "Du hesch chuum no guetzli ih dineri büchs, du sötsch warschinli keini esse"
- AteCookies:
- EN: "You ate {0} cookies, you've only got {1} cookies left"
- CHDE: "Du hesch {0} guetzli gesse und hesch jezt no {1} übrig"
-cookie:
- # because command aliases are to hard to deal with...
- <<: *cookiesAlias
role:
NoRolesConfigured:
EN: "There are no roles configured for this server"
@@ -140,74 +53,4 @@ role:
CHDE: "{0} isch zur whitelist hinzuegfüegt"
RemovedRoleFromWhitelist:
EN: "Removed {0} from the whitelist"
- CHDE: "{0} isch vo dr whitelist glöscht"
-quote:
- NoQuotesFound:
- EN: "This server doesn't seem to have any quotes yet. You can add a quote with `!quote save @user` or `!quote save `"
- CHDE: "Dä server het no kei quotes. Du chasch quotes hinzuefüege mit `!quote save @user` oder `!quote save `"
- CannotSaveOwnQuotes:
- EN: "You can't save your own quotes..."
- CHDE: "Du chasch kei quotes vo dir selber speichere..."
- CannotQuoteBots:
- EN: "You can't save quotes by a bot..."
- CHDE: "Du chasch kei quotes vomne bot speichere..."
- QuoteAdded:
- EN: "**Quote Added**"
- CHDE: "**Quote hinzugfüegt**"
- Removed:
- EN: "**Removed #{0}**"
- CHDE: "**#{0} glöscht**"
- NotFoundWithId:
- EN: "I couldn't find a quote with that ID :disappointed:"
- CHDE: "Ich chan kei quote finde mit därri ID :disappointed:"
- QuoteStats:
- EN: "Quote Stats"
- CHDE: "Quote statistike"
- TotalQuotes:
- EN: "Total"
- CHDE: "Total"
- MostQuotesPerson:
- EN: "Most quoted person"
- CHDE: "Meist quoteti person"
- NotAValidMessageLink:
- EN: "That is not a valid message link"
- CHDE: "Das isch kei korrete nachrichtelink"
- OnlyQuoteFromSameServer:
- EN: "You can only quote messages from the same server"
- CHDE: "Du chasch numme nachrichte vom gliche server quote"
-rank:
- InvalidType:
- EN: "Valid types are '`messages`' '`karma`', '`rolls`' and '`cookies`'"
- CHDE: "Gültigi paramenter sind '`messages`' '`karma`', '`rolls`' und '`cookies`'"
- LimitingTo20Warning:
- EN: ":warning: Limiting to 20\n"
- CHDE: ":warning: Limitiert uf 20\n"
- NoTypeFoundForServer:
- EN: "No {0} found on this server"
- CHDE: "Kei {0} gfunde für dä server"
- FailedToResolveAllUsernames:
- EN: ":warning: I couldn't find all usernames. Maybe they left the server?\n"
- CHDE: ":warning: Ich han nid alli benutzername gfunde. villiicht hend sie de server verlah?\n"
- HighscoresFor:
- EN: ":bar_chart: **{0} Highscore for {1}**"
- CHDE: ":bar_chart: **{0} Highscore für {1}**"
-ship:
- Matchmaking:
- EN: "Matchmaking"
- CHDE: "Verkupple"
- NotGonnaToHappen:
- EN: "Not gonna happen"
- CHDE: "Wird nöd klappe"
- NotSuchAGoodIdea:
- EN: "Not such a good idea"
- CHDE: "Nöd so ä gueti idee"
- ThereMightBeAChance:
- EN: "There might be a chance"
- CHDE: "Es gid eventuel ä chance"
- CouldWork:
- EN: "Almost a match"
- CHDE: "Fasch en match"
- ItsAMatch:
- EN: "It's a match"
- CHDE: "Es isch es traumpaar"
-
\ No newline at end of file
+ CHDE: "{0} isch vo dr whitelist glöscht"
\ No newline at end of file