Start Using resource files (.resx) for translations. Create GeekbotCommandBase to reduce command boilerplate. Convert admin, choose, cookies, karma, quote, rank, roll and ship to the new localization method.

This commit is contained in:
runebaas 2020-08-14 03:30:54 +02:00
parent 12388fd7d0
commit 90af781c7b
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
40 changed files with 1935 additions and 327 deletions

View file

@ -40,4 +40,92 @@
<ProjectReference Include="..\Core\Core.csproj" /> <ProjectReference Include="..\Core\Core.csproj" />
<ProjectReference Include="..\Web\Web.csproj" /> <ProjectReference Include="..\Web\Web.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Localization\Ship.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Ship.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Localization\Rank.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Rank.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Localization\Karma.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Karma.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Localization\Internal.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Internal.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Localization\Cookies.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Cookies.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Localization\Roll.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Roll.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Localization\Choose.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Choose.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Localization\Admin.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Admin.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Localization\Quote.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Quote.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Update="Localization\Ship.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>ship.resx</DependentUpon>
</Compile>
<Compile Update="Localization\Rank.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Rank.resx</DependentUpon>
</Compile>
<Compile Update="Localization\Ship.Designer.cs">
<DependentUpon>Ship.resx</DependentUpon>
</Compile>
<Compile Update="Localization\Karma.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Karma.resx</DependentUpon>
</Compile>
<Compile Update="Localization\Internal.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Internal.resx</DependentUpon>
</Compile>
<Compile Update="Localization\Cookies.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Cookies.resx</DependentUpon>
</Compile>
<Compile Update="Localization\Roll.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Roll.resx</DependentUpon>
</Compile>
<Compile Update="Localization\Choose.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Choose.resx</DependentUpon>
</Compile>
<Compile Update="Localization\Admin.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Admin.resx</DependentUpon>
</Compile>
<Compile Update="Localization\Quote.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Quote.resx</DependentUpon>
</Compile>
</ItemGroup>
</Project> </Project>

View file

@ -1,9 +1,15 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Resources;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket; using Discord.WebSocket;
using Geekbot.Core;
using Geekbot.Core.CommandPreconditions; using Geekbot.Core.CommandPreconditions;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Extensions; using Geekbot.Core.Extensions;
@ -15,19 +21,15 @@ namespace Geekbot.Bot.Commands.Admin
[Group("admin")] [Group("admin")]
[RequireUserPermission(GuildPermission.Administrator)] [RequireUserPermission(GuildPermission.Administrator)]
[DisableInDirectMessage] [DisableInDirectMessage]
public class Admin : ModuleBase public class Admin : GeekbotCommandBase
{ {
private readonly DiscordSocketClient _client; private readonly DiscordSocketClient _client;
private readonly IErrorHandler _errorHandler;
private readonly IGuildSettingsManager _guildSettingsManager; 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; _client = client;
_errorHandler = errorHandler;
_guildSettingsManager = guildSettingsManager; _guildSettingsManager = guildSettingsManager;
_translation = translationHandler;
} }
[Command("welcome", RunMode = RunMode.Async)] [Command("welcome", RunMode = RunMode.Async)]
@ -60,7 +62,7 @@ namespace Geekbot.Bot.Commands.Admin
} }
catch (Exception e) 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) 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) 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) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }
@ -141,24 +143,30 @@ namespace Geekbot.Bot.Commands.Admin
try try
{ {
var language = languageRaw.ToUpper(); var language = languageRaw.ToUpper();
var success = await _translation.SetLanguage(Context.Guild.Id, language); var success = await Translations.SetLanguage(Context.Guild.Id, language);
if (success) if (success)
{ {
var guild = _guildSettingsManager.GetSettings(Context.Guild.Id); var guild = _guildSettingsManager.GetSettings(Context.Guild.Id);
guild.Language = language; guild.Language = language;
await _guildSettingsManager.UpdateSettings(guild); await _guildSettingsManager.UpdateSettings(guild);
var transContext = await _translation.GetGuildContext(Context); if (language.ToLower() == "chde")
await ReplyAsync(transContext.GetString("NewLanguageSet")); {
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("de-ch");
}
await ReplyAsync(Localization.Admin.NewLanguageSet);
return; return;
} }
await ReplyAsync( var available = new List<string>();
$"That doesn't seem to be a supported language\r\nSupported Languages are {string.Join(", ", _translation.SupportedLanguages)}"); 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) 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) 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) 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) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }
@ -230,5 +238,30 @@ namespace Geekbot.Bot.Commands.Admin
return null; return null;
} }
} }
private IEnumerable<CultureInfo> GetAvailableCultures()
{
var result = new List<CultureInfo>();
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;
}
} }
} }

View file

@ -2,6 +2,7 @@
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.Database; using Geekbot.Core.Database;
using Geekbot.Core.Database.Models; using Geekbot.Core.Database.Models;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
@ -12,21 +13,17 @@ using Geekbot.Core.RandomNumberGenerator;
namespace Geekbot.Bot.Commands.Games.Roll namespace Geekbot.Bot.Commands.Games.Roll
{ {
public class Roll : ModuleBase public class Roll : GeekbotCommandBase
{ {
private readonly IErrorHandler _errorHandler;
private readonly IKvInMemoryStore _kvInMemoryStore; private readonly IKvInMemoryStore _kvInMemoryStore;
private readonly ITranslationHandler _translation;
private readonly DatabaseContext _database; private readonly DatabaseContext _database;
private readonly IRandomNumberGenerator _randomNumberGenerator; 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; _kvInMemoryStore = kvInMemoryStore;
_translation = translation;
_database = database; _database = database;
_randomNumberGenerator = randomNumberGenerator; _randomNumberGenerator = randomNumberGenerator;
_errorHandler = errorHandler;
} }
[Command("roll", RunMode = RunMode.Async)] [Command("roll", RunMode = RunMode.Async)]
@ -37,7 +34,7 @@ namespace Geekbot.Bot.Commands.Games.Roll
{ {
var number = _randomNumberGenerator.Next(1, 100); var number = _randomNumberGenerator.Next(1, 100);
int.TryParse(stuff, out var guess); int.TryParse(stuff, out var guess);
var transContext = await _translation.GetGuildContext(Context); var transContext = await Translations.GetGuildContext(Context);
if (guess <= 100 && guess > 0) if (guess <= 100 && guess > 0)
{ {
var kvKey = $"{Context.Guild.Id}:{Context.User.Id}:RollsPrevious"; 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) if (prevRoll?.LastGuess == guess && prevRoll?.GuessedOn.AddDays(1) > DateTime.Now)
{ {
await ReplyAsync(transContext.GetString( await ReplyAsync(string.Format(
"NoPrevGuess", Localization.Roll.NoPrevGuess,
Context.Message.Author.Mention, Context.Message.Author.Mention,
transContext.FormatDateTimeAsRemaining(prevRoll.GuessedOn.AddDays(1)))); transContext.FormatDateTimeAsRemaining(prevRoll.GuessedOn.AddDays(1))));
return; return;
@ -55,10 +52,10 @@ namespace Geekbot.Bot.Commands.Games.Roll
_kvInMemoryStore.Set(kvKey, new RollTimeout { LastGuess = guess, GuessedOn = DateTime.Now }); _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) 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); var user = await GetUser(Context.User.Id);
user.Rolls += 1; user.Rolls += 1;
_database.Rolls.Update(user); _database.Rolls.Update(user);
@ -67,12 +64,12 @@ namespace Geekbot.Bot.Commands.Games.Roll
} }
else 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) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }

View file

@ -3,6 +3,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.Database; using Geekbot.Core.Database;
using Geekbot.Core.Database.Models; using Geekbot.Core.Database.Models;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
@ -12,19 +13,15 @@ using Geekbot.Core.RandomNumberGenerator;
namespace Geekbot.Bot.Commands.Randomness namespace Geekbot.Bot.Commands.Randomness
{ {
public class Ship : ModuleBase public class Ship : GeekbotCommandBase
{ {
private readonly IErrorHandler _errorHandler;
private readonly IRandomNumberGenerator _randomNumberGenerator; private readonly IRandomNumberGenerator _randomNumberGenerator;
private readonly ITranslationHandler _translation;
private readonly DatabaseContext _database; 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; _database = database;
_errorHandler = errorHandler;
_randomNumberGenerator = randomNumberGenerator; _randomNumberGenerator = randomNumberGenerator;
_translation = translation;
} }
[Command("Ship", RunMode = RunMode.Async)] [Command("Ship", RunMode = RunMode.Async)]
@ -58,28 +55,26 @@ namespace Geekbot.Bot.Commands.Randomness
shippingRate = dbval.Strength; shippingRate = dbval.Strength;
} }
var transContext = await _translation.GetGuildContext(Context); var reply = $":heartpulse: **{Localization.Ship.Matchmaking}** :heartpulse:\r\n";
var reply = $":heartpulse: **{transContext.GetString("Matchmaking")}** :heartpulse:\r\n";
reply += $":two_hearts: {user1.Mention} :heart: {user2.Mention} :two_hearts:\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); await ReplyAsync(reply);
} }
catch (Exception e) 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 return (rate / 20) switch
{ {
0 => transContext.GetString("NotGonnaToHappen"), 0 => Localization.Ship.NotGoingToHappen,
1 => transContext.GetString("NotSuchAGoodIdea"), 1 => Localization.Ship.NotSuchAGoodIdea,
2 => transContext.GetString("ThereMightBeAChance"), 2 => Localization.Ship.ThereMightBeAChance,
3 => transContext.GetString("CouldWork"), 3 => Localization.Ship.CouldWork,
4 => transContext.GetString("ItsAMatch"), 4 => Localization.Ship.ItsAMatch,
_ => "nope" _ => "nope"
}; };
} }

View file

@ -3,6 +3,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.CommandPreconditions; using Geekbot.Core.CommandPreconditions;
using Geekbot.Core.Database; using Geekbot.Core.Database;
using Geekbot.Core.Database.Models; using Geekbot.Core.Database.Models;
@ -16,18 +17,14 @@ namespace Geekbot.Bot.Commands.Rpg
[DisableInDirectMessage] [DisableInDirectMessage]
[Group("cookies")] [Group("cookies")]
[Alias("cookie")] [Alias("cookie")]
public class Cookies : ModuleBase public class Cookies : GeekbotCommandBase
{ {
private readonly DatabaseContext _database; private readonly DatabaseContext _database;
private readonly IErrorHandler _errorHandler;
private readonly ITranslationHandler _translation;
private readonly IRandomNumberGenerator _randomNumberGenerator; 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; _database = database;
_errorHandler = errorHandler;
_translation = translation;
_randomNumberGenerator = randomNumberGenerator; _randomNumberGenerator = randomNumberGenerator;
} }
@ -37,23 +34,23 @@ namespace Geekbot.Bot.Commands.Rpg
{ {
try try
{ {
var transContext = await _translation.GetGuildContext(Context); var transContext = await Translations.GetGuildContext(Context);
var actor = await GetUser(Context.User.Id); var actor = await GetUser(Context.User.Id);
if (actor.LastPayout.Value.AddDays(1).Date > DateTime.Now.Date) if (actor.LastPayout.Value.AddDays(1).Date > DateTime.Now.Date)
{ {
var formatedWaitTime = transContext.FormatDateTimeAsRemaining(DateTimeOffset.Now.AddDays(1).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; return;
} }
actor.Cookies += 10; actor.Cookies += 10;
actor.LastPayout = DateTimeOffset.Now; actor.LastPayout = DateTimeOffset.Now;
await SetUser(actor); await SetUser(actor);
await ReplyAsync(transContext.GetString("GetCookies", 10, actor.Cookies)); await ReplyAsync(string.Format(Localization.Cookies.GetCookies, 10, actor.Cookies));
} }
catch (Exception e) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }
@ -63,13 +60,12 @@ namespace Geekbot.Bot.Commands.Rpg
{ {
try try
{ {
var transContext = await _translation.GetGuildContext(Context);
var actor = await GetUser(Context.User.Id); 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) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }
@ -79,12 +75,11 @@ namespace Geekbot.Bot.Commands.Rpg
{ {
try try
{ {
var transContext = await _translation.GetGuildContext(Context);
var giver = await GetUser(Context.User.Id); var giver = await GetUser(Context.User.Id);
if (giver.Cookies < amount) if (giver.Cookies < amount)
{ {
await ReplyAsync(transContext.GetString("NotEnoughToGive")); await ReplyAsync(Localization.Cookies.NotEnoughToGive);
return; return;
} }
@ -96,11 +91,11 @@ namespace Geekbot.Bot.Commands.Rpg
await SetUser(giver); await SetUser(giver);
await SetUser(taker); await SetUser(taker);
await ReplyAsync(transContext.GetString("Given", amount, user.Username)); await ReplyAsync(string.Format(Localization.Cookies.Given, amount, user.Username));
} }
catch (Exception e) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }
@ -110,12 +105,11 @@ namespace Geekbot.Bot.Commands.Rpg
{ {
try try
{ {
var transContext = await _translation.GetGuildContext(Context);
var actor = await GetUser(Context.User.Id); var actor = await GetUser(Context.User.Id);
if (actor.Cookies < 5) if (actor.Cookies < 5)
{ {
await ReplyAsync(transContext.GetString("NotEnoughCookiesToEat")); await ReplyAsync(Localization.Cookies.NotEnoughCookiesToEat);
return; return;
} }
@ -124,11 +118,11 @@ namespace Geekbot.Bot.Commands.Rpg
await SetUser(actor); await SetUser(actor);
await ReplyAsync(transContext.GetString("AteCookies", amount, actor.Cookies)); await ReplyAsync(string.Format(Localization.Cookies.AteCookies, amount, actor.Cookies));
} }
catch (Exception e) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }

View file

@ -1,8 +1,11 @@
using System; using System;
using System.Globalization;
using System.Linq; using System.Linq;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.CommandPreconditions; using Geekbot.Core.CommandPreconditions;
using Geekbot.Core.Database; using Geekbot.Core.Database;
using Geekbot.Core.Database.Models; using Geekbot.Core.Database.Models;
@ -13,17 +16,15 @@ using Geekbot.Core.Localization;
namespace Geekbot.Bot.Commands.User namespace Geekbot.Bot.Commands.User
{ {
[DisableInDirectMessage] [DisableInDirectMessage]
public class Karma : ModuleBase public class Karma : GeekbotCommandBase
{ {
private readonly IErrorHandler _errorHandler;
private readonly DatabaseContext _database; 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; _database = database;
_errorHandler = errorHandler; _translations = translations;
_translation = translation;
} }
[Command("good", RunMode = RunMode.Async)] [Command("good", RunMode = RunMode.Async)]
@ -32,16 +33,17 @@ namespace Geekbot.Bot.Commands.User
{ {
try try
{ {
var transContext = await _translation.GetGuildContext(Context); var transContext = await _translations.GetGuildContext(Context);
var actor = await GetUser(Context.User.Id); var actor = await GetUser(Context.User.Id);
if (user.Id == 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)) else if (TimeoutFinished(actor.TimeOut))
{ {
var formatedWaitTime = transContext.FormatDateTimeAsRemaining(actor.TimeOut.AddMinutes(3)); 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 else
{ {
@ -60,16 +62,16 @@ namespace Geekbot.Bot.Commands.User
.WithName(user.Username)); .WithName(user.Username));
eb.WithColor(new Color(138, 219, 146)); eb.WithColor(new Color(138, 219, 146));
eb.Title = transContext.GetString("Increased"); eb.Title = Localization.Karma.Increased;
eb.AddInlineField(transContext.GetString("By"), Context.User.Username); eb.AddInlineField(Localization.Karma.By, Context.User.Username);
eb.AddInlineField(transContext.GetString("Amount"), "+1"); eb.AddInlineField(Localization.Karma.Amount, "+1");
eb.AddInlineField(transContext.GetString("Current"), target.Karma); eb.AddInlineField(Localization.Karma.Current, target.Karma);
await ReplyAsync("", false, eb.Build()); await ReplyAsync("", false, eb.Build());
} }
} }
catch (Exception e) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }
@ -79,16 +81,17 @@ namespace Geekbot.Bot.Commands.User
{ {
try try
{ {
var transContext = await _translation.GetGuildContext(Context); var transContext = await _translations.GetGuildContext(Context);
var actor = await GetUser(Context.User.Id); var actor = await GetUser(Context.User.Id);
if (user.Id == 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)) else if (TimeoutFinished(actor.TimeOut))
{ {
var formatedWaitTime = transContext.FormatDateTimeAsRemaining(actor.TimeOut.AddMinutes(3)); 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 else
{ {
@ -107,16 +110,16 @@ namespace Geekbot.Bot.Commands.User
.WithName(user.Username)); .WithName(user.Username));
eb.WithColor(new Color(138, 219, 146)); eb.WithColor(new Color(138, 219, 146));
eb.Title = transContext.GetString("Decreased"); eb.Title = Localization.Karma.Decreased;
eb.AddInlineField(transContext.GetString("By"), Context.User.Username); eb.AddInlineField(Localization.Karma.By, Context.User.Username);
eb.AddInlineField(transContext.GetString("Amount"), "-1"); eb.AddInlineField(Localization.Karma.Amount, "-1");
eb.AddInlineField(transContext.GetString("Current"), target.Karma); eb.AddInlineField(Localization.Karma.Current, target.Karma);
await ReplyAsync("", false, eb.Build()); await ReplyAsync("", false, eb.Build());
} }
} }
catch (Exception e) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }

View file

@ -4,6 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.CommandPreconditions; using Geekbot.Core.CommandPreconditions;
using Geekbot.Core.Converters; using Geekbot.Core.Converters;
using Geekbot.Core.Database; using Geekbot.Core.Database;
@ -11,28 +12,20 @@ using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Extensions; using Geekbot.Core.Extensions;
using Geekbot.Core.Highscores; using Geekbot.Core.Highscores;
using Geekbot.Core.Localization; using Geekbot.Core.Localization;
using Geekbot.Core.UserRepository;
namespace Geekbot.Bot.Commands.User.Ranking namespace Geekbot.Bot.Commands.User.Ranking
{ {
public class Rank : ModuleBase public class Rank : GeekbotCommandBase
{ {
private readonly IEmojiConverter _emojiConverter; private readonly IEmojiConverter _emojiConverter;
private readonly IHighscoreManager _highscoreManager; private readonly IHighscoreManager _highscoreManager;
private readonly ITranslationHandler _translationHandler;
private readonly IErrorHandler _errorHandler;
private readonly DatabaseContext _database; private readonly DatabaseContext _database;
private readonly IUserRepository _userRepository;
public Rank(DatabaseContext database, IErrorHandler errorHandler, IUserRepository userRepository, public Rank(DatabaseContext database, IErrorHandler errorHandler, IEmojiConverter emojiConverter, IHighscoreManager highscoreManager, ITranslationHandler translations): base(errorHandler, translations)
IEmojiConverter emojiConverter, IHighscoreManager highscoreManager, ITranslationHandler translationHandler)
{ {
_database = database; _database = database;
_errorHandler = errorHandler;
_userRepository = userRepository;
_emojiConverter = emojiConverter; _emojiConverter = emojiConverter;
_highscoreManager = highscoreManager; _highscoreManager = highscoreManager;
_translationHandler = translationHandler;
} }
[Command("rank", RunMode = RunMode.Async)] [Command("rank", RunMode = RunMode.Async)]
@ -42,7 +35,6 @@ namespace Geekbot.Bot.Commands.User.Ranking
{ {
try try
{ {
var transContext = await _translationHandler.GetGuildContext(Context);
HighscoreTypes type; HighscoreTypes type;
try try
{ {
@ -51,14 +43,14 @@ namespace Geekbot.Bot.Commands.User.Ranking
} }
catch catch
{ {
await ReplyAsync(transContext.GetString("InvalidType")); await ReplyAsync(Localization.Rank.InvalidType);
return; return;
} }
var replyBuilder = new StringBuilder(); var replyBuilder = new StringBuilder();
if (amount > 20) if (amount > 20)
{ {
await ReplyAsync(transContext.GetString("LimitingTo20Warning")); await ReplyAsync(Localization.Rank.LimitingTo20Warning);
amount = 20; amount = 20;
} }
@ -70,7 +62,7 @@ namespace Geekbot.Bot.Commands.User.Ranking
} }
catch (HighscoreListEmptyException) catch (HighscoreListEmptyException)
{ {
await ReplyAsync(transContext.GetString("NoTypeFoundForServer", type)); await ReplyAsync(string.Format(Localization.Rank.NoTypeFoundForServer, type));
return; return;
} }
@ -85,22 +77,24 @@ namespace Geekbot.Bot.Commands.User.Ranking
var failedToRetrieveUser = highscoreUsers.Any(e => string.IsNullOrEmpty(e.Key.Username)); var failedToRetrieveUser = highscoreUsers.Any(e => string.IsNullOrEmpty(e.Key.Username));
if (failedToRetrieveUser) replyBuilder.AppendLine(transContext.GetString("FailedToResolveAllUsernames")); if (failedToRetrieveUser) replyBuilder.AppendLine(Localization.Rank.FailedToResolveAllUsernames).AppendLine();
replyBuilder.AppendLine(transContext.GetString("HighscoresFor", type.ToString().CapitalizeFirst(), Context.Guild.Name));
replyBuilder.AppendLine(string.Format(Localization.Rank.HighscoresFor, type.ToString().CapitalizeFirst(), Context.Guild.Name));
var highscorePlace = 1; var highscorePlace = 1;
foreach (var user in highscoreUsers) foreach (var (user, value) in highscoreUsers)
{ {
replyBuilder.Append(highscorePlace < 11 replyBuilder.Append(highscorePlace < 11
? $"{_emojiConverter.NumberToEmoji(highscorePlace)} " ? $"{_emojiConverter.NumberToEmoji(highscorePlace)} "
: $"`{highscorePlace}.` "); : $"`{highscorePlace}.` ");
replyBuilder.Append(user.Key.Username != null replyBuilder.Append(user.Username != null
? $"**{user.Key.Username}#{user.Key.Discriminator}**" ? $"**{user.Username}#{user.Discriminator}**"
: $"**{user.Key.Id}**"); : $"**{user.Id}**");
replyBuilder.Append(type == HighscoreTypes.messages replyBuilder.Append(type == HighscoreTypes.messages
? $" - {user.Value} {type} - {Math.Round((double) (100 * user.Value) / guildMessages, 2)}%\n" ? $" - {value} {type} - {Math.Round((double) (100 * value) / guildMessages, 2)}%\n"
: $" - {user.Value} {type}\n"); : $" - {value} {type}\n");
highscorePlace++; highscorePlace++;
} }
@ -109,7 +103,7 @@ namespace Geekbot.Bot.Commands.User.Ranking
} }
catch (Exception e) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }
} }

View file

@ -1,20 +1,16 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Localization; using Geekbot.Core.Localization;
namespace Geekbot.Bot.Commands.Utils namespace Geekbot.Bot.Commands.Utils
{ {
public class Choose : ModuleBase public class Choose : GeekbotCommandBase
{ {
private readonly IErrorHandler _errorHandler; public Choose(IErrorHandler errorHandler, ITranslationHandler translation) : base(errorHandler, translation)
private readonly ITranslationHandler _translation;
public Choose(IErrorHandler errorHandler, ITranslationHandler translation)
{ {
_errorHandler = errorHandler;
_translation = translation;
} }
[Command("choose", RunMode = RunMode.Async)] [Command("choose", RunMode = RunMode.Async)]
@ -24,14 +20,13 @@ namespace Geekbot.Bot.Commands.Utils
{ {
try try
{ {
var transContext = await _translation.GetGuildContext(Context);
var choicesArray = choices.Split(';'); var choicesArray = choices.Split(';');
var choice = new Random().Next(choicesArray.Length); 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) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }
} }

View file

@ -17,20 +17,16 @@ namespace Geekbot.Bot.Commands.Utils.Quote
{ {
[Group("quote")] [Group("quote")]
[DisableInDirectMessage] [DisableInDirectMessage]
public class Quote : ModuleBase public class Quote : GeekbotCommandBase
{ {
private readonly IErrorHandler _errorHandler;
private readonly DatabaseContext _database; private readonly DatabaseContext _database;
private readonly IRandomNumberGenerator _randomNumberGenerator; private readonly IRandomNumberGenerator _randomNumberGenerator;
private readonly ITranslationHandler _translationHandler;
private readonly bool _isDev; 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; _database = database;
_randomNumberGenerator = randomNumberGenerator; _randomNumberGenerator = randomNumberGenerator;
_translationHandler = translationHandler;
// to remove restrictions when developing // to remove restrictions when developing
_isDev = Constants.BotVersion() == "0.0.0-DEV"; _isDev = Constants.BotVersion() == "0.0.0-DEV";
} }
@ -45,8 +41,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
if (!s.Any()) if (!s.Any())
{ {
var transContext = await _translationHandler.GetGuildContext(Context); await ReplyAsync(Localization.Quote.NoQuotesFound);
await ReplyAsync(transContext.GetString("NoQuotesFound"));
return; return;
} }
@ -58,7 +53,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
} }
catch (Exception e) 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 try
{ {
var transContext = await _translationHandler.GetGuildContext(Context);
var quote = _database.Quotes.Where(e => e.GuildId == Context.Guild.Id.AsLong() && e.InternalId == id)?.FirstOrDefault(); var quote = _database.Quotes.Where(e => e.GuildId == Context.Guild.Id.AsLong() && e.InternalId == id)?.FirstOrDefault();
if (quote != null) if (quote != null)
{ {
_database.Quotes.Remove(quote); _database.Quotes.Remove(quote);
await _database.SaveChangesAsync(); await _database.SaveChangesAsync();
var embed = QuoteBuilder(quote); 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 else
{ {
await ReplyAsync(transContext.GetString("NotFoundWithId")); await ReplyAsync(Localization.Quote.NotFoundWithId);
} }
} }
catch (Exception e) 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 try
{ {
// setup // setup
var transContext = await _translationHandler.GetGuildContext(Context);
var eb = new EmbedBuilder(); var eb = new EmbedBuilder();
eb.Author = new EmbedAuthorBuilder() eb.Author = new EmbedAuthorBuilder()
{ {
IconUrl = Context.Guild.IconUrl, IconUrl = Context.Guild.IconUrl,
Name = $"{Context.Guild.Name} - {transContext.GetString("QuoteStats")}" Name = $"{Context.Guild.Name} - {Localization.Quote.QuoteStats}"
}; };
// gather data // gather data
@ -157,7 +150,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
if (totalQuotes == 0) if (totalQuotes == 0)
{ {
// no quotes, no stats, end of the road // no quotes, no stats, end of the road
await ReplyAsync(transContext.GetString("NoQuotesFound")); await ReplyAsync(Localization.Quote.NoQuotesFound);
return; return;
} }
@ -176,8 +169,8 @@ namespace Geekbot.Bot.Commands.Utils.Quote
.OrderBy(row => row.year); .OrderBy(row => row.year);
// add data to the embed // add data to the embed
eb.AddField(transContext.GetString("MostQuotesPerson"), $"{mostQuotedPersonUser.Username} ({mostQuotedPerson.amount})"); eb.AddField(Localization.Quote.MostQuotesPerson, $"{mostQuotedPersonUser.Username} ({mostQuotedPerson.amount})");
eb.AddInlineField(transContext.GetString("TotalQuotes"), totalQuotes); eb.AddInlineField(Localization.Quote.TotalQuotes, totalQuotes);
foreach (var year in quotesByYear) foreach (var year in quotesByYear)
{ {
@ -188,7 +181,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
} }
catch (Exception e) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await ErrorHandler.HandleCommandException(e, Context);
} }
} }
@ -196,8 +189,6 @@ namespace Geekbot.Bot.Commands.Utils.Quote
{ {
try try
{ {
var transContext = await _translationHandler.GetGuildContext(Context);
var list = Context.Channel.GetMessagesAsync().Flatten(); var list = Context.Channel.GetMessagesAsync().Flatten();
var message = await list.FirstOrDefaultAsync(msg => var message = await list.FirstOrDefaultAsync(msg =>
msg.Author.Id == user.Id && msg.Author.Id == user.Id &&
@ -206,11 +197,11 @@ namespace Geekbot.Bot.Commands.Utils.Quote
!msg.Content.ToLower().StartsWith("!")); !msg.Content.ToLower().StartsWith("!"));
if (message == null) return; if (message == null) return;
await ProcessQuote(message, saveToDb, transContext); await ProcessQuote(message, saveToDb);
} }
catch (Exception e) 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 try
{ {
var transContext = await _translationHandler.GetGuildContext(Context); // var transContext = await _translationHandler.GetGuildContext(Context);
var message = await Context.Channel.GetMessageAsync(messageId); var message = await Context.Channel.GetMessageAsync(messageId);
await ProcessQuote(message, saveToDb, transContext); await ProcessQuote(message, saveToDb);
} }
catch (Exception e) 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 try
{ {
var transContext = await _translationHandler.GetGuildContext(Context); // var transContext = await _translationHandler.GetGuildContext(Context);
if (!MessageLink.IsValid(messageLink)) if (!MessageLink.IsValid(messageLink))
{ {
await ReplyAsync(transContext.GetString("NotAValidMessageLink")); await ReplyAsync(Localization.Quote.NotAValidMessageLink);
return; return;
} }
var link = new MessageLink(messageLink); var link = new MessageLink(messageLink);
if (link.GuildId != Context.Guild.Id) if (link.GuildId != Context.Guild.Id)
{ {
await ReplyAsync(transContext.GetString("OnlyQuoteFromSameServer")); await ReplyAsync(Localization.Quote.OnlyQuoteFromSameServer);
return; return;
} }
@ -255,25 +246,25 @@ namespace Geekbot.Bot.Commands.Utils.Quote
var message = await channel.GetMessageAsync(link.MessageId); var message = await channel.GetMessageAsync(link.MessageId);
await ProcessQuote(message, saveToDb, transContext); await ProcessQuote(message, saveToDb);
} }
catch (Exception e) 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) if (message.Author.Id == Context.Message.Author.Id && saveToDb && !_isDev)
{ {
await ReplyAsync(transContext.GetString("CannotSaveOwnQuotes")); await ReplyAsync(Localization.Quote.CannotSaveOwnQuotes);
return; return;
} }
if (message.Author.IsBot && saveToDb && !_isDev) if (message.Author.IsBot && saveToDb && !_isDev)
{ {
await ReplyAsync(transContext.GetString("CannotQuoteBots")); await ReplyAsync(Localization.Quote.CannotQuoteBots);
return; return;
} }
@ -285,7 +276,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
} }
var embed = QuoteBuilder(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) private EmbedBuilder QuoteBuilder(QuoteModel quote)

81
src/Bot/Localization/Admin.Designer.cs generated Normal file
View file

@ -0,0 +1,81 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Geekbot.Bot.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to I&apos;m talking english.
/// </summary>
internal static string GetLanguage {
get {
return ResourceManager.GetString("GetLanguage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to I will reply in english from now on.
/// </summary>
internal static string NewLanguageSet {
get {
return ResourceManager.GetString("NewLanguageSet", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,20 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="NewLanguageSet" xml:space="preserve">
<value>I werd ab jetzt uf schwiizerdüütsch antworte, äuuä</value>
</data>
<data name="GetLanguage" xml:space="preserve">
<value>I red schwiizerdüütsch</value>
</data>
</root>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="NewLanguageSet" xml:space="preserve">
<value>I will reply in english from now on</value>
</data>
<data name="GetLanguage" xml:space="preserve">
<value>I'm talking english</value>
</data>
</root>

72
src/Bot/Localization/Choose.Designer.cs generated Normal file
View file

@ -0,0 +1,72 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Geekbot.Bot.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to I Choose **{0}**.
/// </summary>
internal static string Choice {
get {
return ResourceManager.GetString("Choice", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,17 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Choice" xml:space="preserve">
<value>I nimme **{0}**</value>
</data>
</root>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Choice" xml:space="preserve">
<value>I Choose **{0}**</value>
</data>
</root>

126
src/Bot/Localization/Cookies.Designer.cs generated Normal file
View file

@ -0,0 +1,126 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Geekbot.Bot.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to You ate {0} cookies, you&apos;ve only got {1} cookies left.
/// </summary>
internal static string AteCookies {
get {
return ResourceManager.GetString("AteCookies", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You got {0} cookies, there are now {1} cookies in you cookie jar.
/// </summary>
internal static string GetCookies {
get {
return ResourceManager.GetString("GetCookies", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You gave {0} cookies to {1}.
/// </summary>
internal static string Given {
get {
return ResourceManager.GetString("Given", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to There are {0} cookies in you cookie jar.
/// </summary>
internal static string InYourJar {
get {
return ResourceManager.GetString("InYourJar", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Your cookie jar looks almost empty, you should probably not eat a cookie.
/// </summary>
internal static string NotEnoughCookiesToEat {
get {
return ResourceManager.GetString("NotEnoughCookiesToEat", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You don&apos;t have enough cookies.
/// </summary>
internal static string NotEnoughToGive {
get {
return ResourceManager.GetString("NotEnoughToGive", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You already got cookies today, you can have more cookies in {0}.
/// </summary>
internal static string WaitForMoreCookies {
get {
return ResourceManager.GetString("WaitForMoreCookies", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,35 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="GetCookies" xml:space="preserve">
<value>Du häsch {0} guetzli becho, du häsch jetzt {1} guetzli ih dr büchse</value>
</data>
<data name="WaitForMoreCookies" xml:space="preserve">
<value>Du hesch scho guetzli becho hüt, du chasch meh ha in {0}</value>
</data>
<data name="InYourJar" xml:space="preserve">
<value>Es hät {0} guetzli ih dineri büchs</value>
</data>
<data name="Given" xml:space="preserve">
<value>Du hesch {1} {0} guetzli geh</value>
</data>
<data name="NotEnoughToGive" xml:space="preserve">
<value>Du hesch nid gnueg guetzli</value>
</data>
<data name="NotEnoughCookiesToEat" xml:space="preserve">
<value>Du hesch chuum no guetzli ih dineri büchs, du sötsch warschinli keini esse</value>
</data>
<data name="AteCookies" xml:space="preserve">
<value>Du hesch {0} guetzli gesse und hesch jezt no {1} übrig</value>
</data>
</root>

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="GetCookies" xml:space="preserve">
<value>You got {0} cookies, there are now {1} cookies in you cookie jar</value>
</data>
<data name="WaitForMoreCookies" xml:space="preserve">
<value>You already got cookies today, you can have more cookies in {0}</value>
</data>
<data name="InYourJar" xml:space="preserve">
<value>There are {0} cookies in you cookie jar</value>
</data>
<data name="Given" xml:space="preserve">
<value>You gave {0} cookies to {1}</value>
</data>
<data name="NotEnoughToGive" xml:space="preserve">
<value>You don't have enough cookies</value>
</data>
<data name="NotEnoughCookiesToEat" xml:space="preserve">
<value>Your cookie jar looks almost empty, you should probably not eat a cookie</value>
</data>
<data name="AteCookies" xml:space="preserve">
<value>You ate {0} cookies, you've only got {1} cookies left</value>
</data>
</root>

126
src/Bot/Localization/Internal.Designer.cs generated Normal file
View file

@ -0,0 +1,126 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Geekbot.Bot.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to and.
/// </summary>
internal static string And {
get {
return ResourceManager.GetString("And", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to day|days.
/// </summary>
internal static string Days {
get {
return ResourceManager.GetString("Days", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to hour|hours.
/// </summary>
internal static string Hours {
get {
return ResourceManager.GetString("Hours", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Seems like i don&apos;t have enough permission to that :confused:.
/// </summary>
internal static string Http403 {
get {
return ResourceManager.GetString("Http403", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to minute|minutes.
/// </summary>
internal static string Minutes {
get {
return ResourceManager.GetString("Minutes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to second|seconds.
/// </summary>
internal static string Seconds {
get {
return ResourceManager.GetString("Seconds", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Something went wrong :confused:.
/// </summary>
internal static string SomethingWentWrong {
get {
return ResourceManager.GetString("SomethingWentWrong", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,35 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="SomethingWentWrong" xml:space="preserve">
<value>Öppis isch schief gange :confused:</value>
</data>
<data name="Http403" xml:space="preserve">
<value>Gseht danach us das ich nid gnueg recht han zum das mache :confused:</value>
</data>
<data name="Days" xml:space="preserve">
<value>tag|täg</value>
</data>
<data name="Hours" xml:space="preserve">
<value>stund|stunde</value>
</data>
<data name="Minutes" xml:space="preserve">
<value>minute|minute</value>
</data>
<data name="Seconds" xml:space="preserve">
<value>sekunde|sekunde</value>
</data>
<data name="And" xml:space="preserve">
<value>und</value>
</data>
</root>

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="SomethingWentWrong" xml:space="preserve">
<value>Something went wrong :confused:</value>
</data>
<data name="Http403" xml:space="preserve">
<value>Seems like i don't have enough permission to that :confused:</value>
</data>
<data name="Days" xml:space="preserve">
<value>day|days</value>
</data>
<data name="Hours" xml:space="preserve">
<value>hour|hours</value>
</data>
<data name="Minutes" xml:space="preserve">
<value>minute|minutes</value>
</data>
<data name="Seconds" xml:space="preserve">
<value>second|seconds</value>
</data>
<data name="And" xml:space="preserve">
<value>and</value>
</data>
</root>

135
src/Bot/Localization/Karma.Designer.cs generated Normal file
View file

@ -0,0 +1,135 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Geekbot.Bot.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Amount.
/// </summary>
internal static string Amount {
get {
return ResourceManager.GetString("Amount", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to By.
/// </summary>
internal static string By {
get {
return ResourceManager.GetString("By", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sorry {0}, but you can&apos;t lower your own karma.
/// </summary>
internal static string CannotChangeOwnDown {
get {
return ResourceManager.GetString("CannotChangeOwnDown", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sorry {0}, but you can&apos;t give yourself karma.
/// </summary>
internal static string CannotChangeOwnUp {
get {
return ResourceManager.GetString("CannotChangeOwnUp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Current.
/// </summary>
internal static string Current {
get {
return ResourceManager.GetString("Current", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Karma lowered.
/// </summary>
internal static string Decreased {
get {
return ResourceManager.GetString("Decreased", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gained Karma.
/// </summary>
internal static string Increased {
get {
return ResourceManager.GetString("Increased", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sorry {0}, but you have to wait {1} before you can give karma again....
/// </summary>
internal static string WaitUntill {
get {
return ResourceManager.GetString("WaitUntill", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,38 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CannotChangeOwnUp" xml:space="preserve">
<value>Sorry {0}, aber du chasch dr selber kei karma geh</value>
</data>
<data name="WaitUntill" xml:space="preserve">
<value>Sorry {0}, aber du musch no {1} warte bisch d wieder karma chasch geh...</value>
</data>
<data name="Increased" xml:space="preserve">
<value>Karma becho</value>
</data>
<data name="By" xml:space="preserve">
<value>Vo</value>
</data>
<data name="Amount" xml:space="preserve">
<value>Mengi</value>
</data>
<data name="Current" xml:space="preserve">
<value>Jetzt</value>
</data>
<data name="CannotChangeOwnDown" xml:space="preserve">
<value>Sorry {0}, aber du chasch dr din eigete karma nid weg neh</value>
</data>
<data name="Decreased" xml:space="preserve">
<value>Karma gsenkt</value>
</data>
</root>

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CannotChangeOwnUp" xml:space="preserve">
<value>Sorry {0}, but you can't give yourself karma</value>
</data>
<data name="WaitUntill" xml:space="preserve">
<value>Sorry {0}, but you have to wait {1} before you can give karma again...</value>
</data>
<data name="Increased" xml:space="preserve">
<value>Gained Karma</value>
</data>
<data name="By" xml:space="preserve">
<value>By</value>
</data>
<data name="Amount" xml:space="preserve">
<value>Amount</value>
</data>
<data name="Current" xml:space="preserve">
<value>Current</value>
</data>
<data name="CannotChangeOwnDown" xml:space="preserve">
<value>Sorry {0}, but you can't lower your own karma</value>
</data>
<data name="Decreased" xml:space="preserve">
<value>Karma lowered</value>
</data>
</root>

162
src/Bot/Localization/Quote.Designer.cs generated Normal file
View file

@ -0,0 +1,162 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Geekbot.Bot.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to You can&apos;t save quotes by a bot....
/// </summary>
internal static string CannotQuoteBots {
get {
return ResourceManager.GetString("CannotQuoteBots", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You can&apos;t save your own quotes....
/// </summary>
internal static string CannotSaveOwnQuotes {
get {
return ResourceManager.GetString("CannotSaveOwnQuotes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Most quoted person.
/// </summary>
internal static string MostQuotesPerson {
get {
return ResourceManager.GetString("MostQuotesPerson", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This server doesn&apos;t seem to have any quotes yet. You can add a quote with `!quote save @user` or `!quote save &lt;messageId&gt;`.
/// </summary>
internal static string NoQuotesFound {
get {
return ResourceManager.GetString("NoQuotesFound", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to That is not a valid message link.
/// </summary>
internal static string NotAValidMessageLink {
get {
return ResourceManager.GetString("NotAValidMessageLink", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to I couldn&apos;t find a quote with that ID :disappointed:.
/// </summary>
internal static string NotFoundWithId {
get {
return ResourceManager.GetString("NotFoundWithId", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You can only quote messages from the same server.
/// </summary>
internal static string OnlyQuoteFromSameServer {
get {
return ResourceManager.GetString("OnlyQuoteFromSameServer", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to **Quote Added**.
/// </summary>
internal static string QuoteAdded {
get {
return ResourceManager.GetString("QuoteAdded", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Quote Stats.
/// </summary>
internal static string QuoteStats {
get {
return ResourceManager.GetString("QuoteStats", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to **Removed #{0}**.
/// </summary>
internal static string Removed {
get {
return ResourceManager.GetString("Removed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Total.
/// </summary>
internal static string TotalQuotes {
get {
return ResourceManager.GetString("TotalQuotes", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,47 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="NoQuotesFound" xml:space="preserve">
<value>Dä server het no kei quotes. Du chasch quotes hinzuefüege mit `!quote save @user` oder `!quote save &lt;messageId&gt;`</value>
</data>
<data name="CannotSaveOwnQuotes" xml:space="preserve">
<value>Du chasch kei quotes vo dir selber speichere...</value>
</data>
<data name="CannotQuoteBots" xml:space="preserve">
<value>Du chasch kei quotes vomne bot speichere...</value>
</data>
<data name="QuoteAdded" xml:space="preserve">
<value>**Quote hinzugfüegt**</value>
</data>
<data name="Removed" xml:space="preserve">
<value>**#{0} glöscht**</value>
</data>
<data name="NotFoundWithId" xml:space="preserve">
<value>Ich chan kei quote finde mit därri ID :disappointed:</value>
</data>
<data name="QuoteStats" xml:space="preserve">
<value>Quote statistike</value>
</data>
<data name="TotalQuotes" xml:space="preserve">
<value>Total</value>
</data>
<data name="MostQuotesPerson" xml:space="preserve">
<value>Meist quoteti person</value>
</data>
<data name="NotAValidMessageLink" xml:space="preserve">
<value>Das isch kei korrete nachrichtelink</value>
</data>
<data name="OnlyQuoteFromSameServer" xml:space="preserve">
<value>Du chasch numme nachrichte vom gliche server quote</value>
</data>
</root>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="NoQuotesFound" xml:space="preserve">
<value>This server doesn't seem to have any quotes yet. You can add a quote with `!quote save @user` or `!quote save &lt;messageId&gt;`</value>
</data>
<data name="CannotSaveOwnQuotes" xml:space="preserve">
<value>You can't save your own quotes...</value>
</data>
<data name="CannotQuoteBots" xml:space="preserve">
<value>You can't save quotes by a bot...</value>
</data>
<data name="QuoteAdded" xml:space="preserve">
<value>**Quote Added**</value>
</data>
<data name="Removed" xml:space="preserve">
<value>**Removed #{0}**</value>
</data>
<data name="NotFoundWithId" xml:space="preserve">
<value>I couldn't find a quote with that ID :disappointed:</value>
</data>
<data name="QuoteStats" xml:space="preserve">
<value>Quote Stats</value>
</data>
<data name="TotalQuotes" xml:space="preserve">
<value>Total</value>
</data>
<data name="MostQuotesPerson" xml:space="preserve">
<value>Most quoted person</value>
</data>
<data name="NotAValidMessageLink" xml:space="preserve">
<value>That is not a valid message link</value>
</data>
<data name="OnlyQuoteFromSameServer" xml:space="preserve">
<value>You can only quote messages from the same server</value>
</data>
</root>

108
src/Bot/Localization/Rank.Designer.cs generated Normal file
View file

@ -0,0 +1,108 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Geekbot.Bot.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to :warning: I couldn&apos;t find all usernames. Maybe they left the server?.
/// </summary>
internal static string FailedToResolveAllUsernames {
get {
return ResourceManager.GetString("FailedToResolveAllUsernames", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to :bar_chart: **{0} Highscore for {1}**.
/// </summary>
internal static string HighscoresFor {
get {
return ResourceManager.GetString("HighscoresFor", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Valid types are &apos;`messages`&apos; &apos;`karma`&apos;, &apos;`rolls`&apos; and &apos;`cookies`&apos;.
/// </summary>
internal static string InvalidType {
get {
return ResourceManager.GetString("InvalidType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to :warning: Limiting to 20.
/// </summary>
internal static string LimitingTo20Warning {
get {
return ResourceManager.GetString("LimitingTo20Warning", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No {0} found on this server.
/// </summary>
internal static string NoTypeFoundForServer {
get {
return ResourceManager.GetString("NoTypeFoundForServer", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,29 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="LimitingTo20Warning" xml:space="preserve">
<value>:warning: Limitiert uf 20</value>
</data>
<data name="NoTypeFoundForServer" xml:space="preserve">
<value>Kei {0} gfunde für dä server</value>
</data>
<data name="FailedToResolveAllUsernames" xml:space="preserve">
<value>:warning: Ich han nid alli benutzername gfunde. villiicht hend sie de server verlah?</value>
</data>
<data name="HighscoresFor" xml:space="preserve">
<value>:bar_chart: **{0} Highscore für {1}**</value>
</data>
<data name="InvalidType" xml:space="preserve">
<value>Gültigi paramenter sind '`messages`' '`karma`', '`rolls`' und '`cookies`</value>
</data>
</root>

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="InvalidType" xml:space="preserve">
<value>Valid types are '`messages`' '`karma`', '`rolls`' and '`cookies`'</value>
</data>
<data name="LimitingTo20Warning" xml:space="preserve">
<value>:warning: Limiting to 20</value>
</data>
<data name="NoTypeFoundForServer" xml:space="preserve">
<value>No {0} found on this server</value>
</data>
<data name="FailedToResolveAllUsernames" xml:space="preserve">
<value>:warning: I couldn't find all usernames. Maybe they left the server?</value>
</data>
<data name="HighscoresFor" xml:space="preserve">
<value>:bar_chart: **{0} Highscore for {1}**</value>
</data>
</root>

99
src/Bot/Localization/Roll.Designer.cs generated Normal file
View file

@ -0,0 +1,99 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Geekbot.Bot.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Congratulations {0}, your guess was correct!.
/// </summary>
internal static string Gratz {
get {
return ResourceManager.GetString("Gratz", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to :red_circle: {0}, you can&apos;t guess the same number again, guess another number or wait {1}.
/// </summary>
internal static string NoPrevGuess {
get {
return ResourceManager.GetString("NoPrevGuess", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0}, you rolled {1}, your guess was {2}.
/// </summary>
internal static string Rolled {
get {
return ResourceManager.GetString("Rolled", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0}, you rolled {1}.
/// </summary>
internal static string RolledNoGuess {
get {
return ResourceManager.GetString("RolledNoGuess", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,26 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Rolled" xml:space="preserve">
<value>{0}, du hesch {1} grollt und hesch {2} grate</value>
</data>
<data name="Gratz" xml:space="preserve">
<value>Gratuliere {0}, du hesch richtig grate!</value>
</data>
<data name="RolledNoGuess" xml:space="preserve">
<value>{0}, du hesch {1} grollt</value>
</data>
<data name="NoPrevGuess" xml:space="preserve">
<value>:red_circle: {0}, du chasch nid nomol es gliche rate, rate öppis anders oder warte {1}</value>
</data>
</root>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Rolled" xml:space="preserve">
<value>{0}, you rolled {1}, your guess was {2}</value>
</data>
<data name="Gratz" xml:space="preserve">
<value>Congratulations {0}, your guess was correct!</value>
</data>
<data name="RolledNoGuess" xml:space="preserve">
<value>{0}, you rolled {1}</value>
</data>
<data name="NoPrevGuess" xml:space="preserve">
<value>:red_circle: {0}, you can't guess the same number again, guess another number or wait {1}</value>
</data>
</root>

117
src/Bot/Localization/Ship.Designer.cs generated Normal file
View file

@ -0,0 +1,117 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Geekbot.Bot.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Almost a match.
/// </summary>
internal static string CouldWork {
get {
return ResourceManager.GetString("CouldWork", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to It&apos;s a match.
/// </summary>
internal static string ItsAMatch {
get {
return ResourceManager.GetString("ItsAMatch", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Matchmaking.
/// </summary>
internal static string Matchmaking {
get {
return ResourceManager.GetString("Matchmaking", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Not going happen.
/// </summary>
internal static string NotGoingToHappen {
get {
return ResourceManager.GetString("NotGoingToHappen", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Not such a good idea.
/// </summary>
internal static string NotSuchAGoodIdea {
get {
return ResourceManager.GetString("NotSuchAGoodIdea", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to There might be a chance.
/// </summary>
internal static string ThereMightBeAChance {
get {
return ResourceManager.GetString("ThereMightBeAChance", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,32 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Matchmaking" xml:space="preserve">
<value>Verkupple</value>
</data>
<data name="NotGoingToHappen" xml:space="preserve">
<value>Wird nöd klappe</value>
</data>
<data name="NotSuchAGoodIdea" xml:space="preserve">
<value>Nöd so ä gueti idee</value>
</data>
<data name="ThereMightBeAChance" xml:space="preserve">
<value>Es gid eventuel ä chance</value>
</data>
<data name="CouldWork" xml:space="preserve">
<value>Fasch en match</value>
</data>
<data name="ItsAMatch" xml:space="preserve">
<value>Es isch es traumpaar</value>
</data>
</root>

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Matchmaking" xml:space="preserve">
<value>Matchmaking</value>
</data>
<data name="NotGoingToHappen" xml:space="preserve">
<value>Not going happen</value>
</data>
<data name="NotSuchAGoodIdea" xml:space="preserve">
<value>Not such a good idea</value>
</data>
<data name="ThereMightBeAChance" xml:space="preserve">
<value>There might be a chance</value>
</data>
<data name="CouldWork" xml:space="preserve">
<value>Almost a match</value>
</data>
<data name="ItsAMatch" xml:space="preserve">
<value>It's a match</value>
</data>
</root>

View file

@ -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<ICommandContext>
{
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);
}
}
}

View file

@ -12,5 +12,6 @@ namespace Geekbot.Core.Localization
Task<TranslationGuildContext> GetGuildContext(ICommandContext context); Task<TranslationGuildContext> GetGuildContext(ICommandContext context);
Task<bool> SetLanguage(ulong guildId, string language); Task<bool> SetLanguage(ulong guildId, string language);
List<string> SupportedLanguages { get; } List<string> SupportedLanguages { get; }
string GetServerLanguage(ulong guildId);
} }
} }

View file

@ -89,7 +89,7 @@ namespace Geekbot.Core.Localization
} }
} }
private Task<string> GetServerLanguage(ulong guildId) public string GetServerLanguage(ulong guildId)
{ {
try try
{ {
@ -99,7 +99,7 @@ namespace Geekbot.Core.Localization
lang = _serverLanguages[guildId]; lang = _serverLanguages[guildId];
if (!string.IsNullOrEmpty(lang)) if (!string.IsNullOrEmpty(lang))
{ {
return Task.FromResult(lang); return lang;
} }
throw new Exception(); throw new Exception();
} }
@ -107,19 +107,19 @@ namespace Geekbot.Core.Localization
{ {
lang = _guildSettingsManager.GetSettings(guildId, false)?.Language ?? "EN"; lang = _guildSettingsManager.GetSettings(guildId, false)?.Language ?? "EN";
_serverLanguages[guildId] = lang; _serverLanguages[guildId] = lang;
return Task.FromResult(lang); return lang;
} }
} }
catch (Exception e) catch (Exception e)
{ {
_logger.Error(LogSource.Geekbot, "Could not get guild language", e); _logger.Error(LogSource.Geekbot, "Could not get guild language", e);
return Task.FromResult("EN"); return "EN";
} }
} }
public async Task<string> GetString(ulong guildId, string command, string stringName) public async Task<string> GetString(ulong guildId, string command, string stringName)
{ {
var serverLang = await GetServerLanguage(guildId); var serverLang = GetServerLanguage(guildId);
return GetString(serverLang, command, stringName); return GetString(serverLang, command, stringName);
} }
@ -140,7 +140,7 @@ namespace Geekbot.Core.Localization
try try
{ {
var command = context.Message.Content.Split(' ').First().TrimStart('!').ToLower(); 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]; return _translations[serverLanguage][command];
} }
catch (Exception e) catch (Exception e)
@ -153,7 +153,7 @@ namespace Geekbot.Core.Localization
public async Task<TranslationGuildContext> GetGuildContext(ICommandContext context) public async Task<TranslationGuildContext> GetGuildContext(ICommandContext context)
{ {
var dict = await GetDict(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); return new TranslationGuildContext(this, language, dict);
} }
@ -161,7 +161,7 @@ namespace Geekbot.Core.Localization
{ {
try try
{ {
var serverLanguage = await GetServerLanguage(context.Guild?.Id ?? 0); var serverLanguage = GetServerLanguage(context.Guild?.Id ?? 0);
return _translations[serverLanguage][command]; return _translations[serverLanguage][command];
} }
catch (Exception e) catch (Exception e)

View file

@ -15,13 +15,6 @@ dateTime:
And: And:
EN: "and" EN: "and"
CHDE: "und" 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: errorHandler:
SomethingWentWrong: SomethingWentWrong:
EN: "Something went wrong :confused:" EN: "Something went wrong :confused:"
@ -30,86 +23,6 @@ httpErrors:
403: 403:
EN: "Seems like i don't have enough permission to that :confused:" 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:" 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: role:
NoRolesConfigured: NoRolesConfigured:
EN: "There are no roles configured for this server" EN: "There are no roles configured for this server"
@ -141,73 +54,3 @@ role:
RemovedRoleFromWhitelist: RemovedRoleFromWhitelist:
EN: "Removed {0} from the whitelist" EN: "Removed {0} from the whitelist"
CHDE: "{0} isch vo dr whitelist glöscht" 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 <messageId>`"
CHDE: "Dä server het no kei quotes. Du chasch quotes hinzuefüege mit `!quote save @user` oder `!quote save <messageId>`"
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"