Changed (almost) all responses to make them use the new system instead of raw strings

- Fixed many invalid string keys
This commit is contained in:
Kwoth
2021-07-30 22:42:10 +02:00
parent 4484732f5d
commit 919bedeae6
80 changed files with 883 additions and 859 deletions

View File

@@ -54,7 +54,7 @@ namespace NadekoBot.Modules.Games
}
else
{
await ReplyErrorLocalizedAsync("acro_running").ConfigureAwait(false);
await ReplyErrorLocalizedAsync(strs.acro_running).ConfigureAwait(false);
}
Task _client_MessageReceived(SocketMessage msg)
@@ -116,10 +116,10 @@ namespace NadekoBot.Modules.Games
var embed = _eb.Create()
.WithOkColor()
.WithTitle(GetText(strs.acrophobia) + " - " + GetText(strs.submissions_closed))
.WithDescription(GetText(strs.acro_nym_was(Format.Bold(string.Join(".", game.StartingLetters))) + "\n" +
.WithDescription(GetText(strs.acro_nym_was(Format.Bold(string.Join(".", game.StartingLetters)) + "\n" +
$@"--
{submissions.Aggregate("", (agg, cur) => agg + $"`{++i}.` **{cur.Key.Input}**\n")}
--"))
--")))
.WithFooter(GetText(strs.acro_vote));
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);

View File

@@ -37,7 +37,7 @@ namespace NadekoBot.Modules.Games
uow.GuildConfigs.SetCleverbotEnabled(ctx.Guild.Id, false);
await uow.SaveChangesAsync();
}
await ReplyConfirmLocalizedAsync("cleverbot_disabled").ConfigureAwait(false);
await ReplyConfirmLocalizedAsync(strs.cleverbot_disabled).ConfigureAwait(false);
return;
}
@@ -49,7 +49,7 @@ namespace NadekoBot.Modules.Games
await uow.SaveChangesAsync();
}
await ReplyConfirmLocalizedAsync("cleverbot_enabled").ConfigureAwait(false);
await ReplyConfirmLocalizedAsync(strs.cleverbot_enabled).ConfigureAwait(false);
}
}

View File

@@ -63,7 +63,7 @@ namespace NadekoBot.Modules.Games
if (originalStream is null)
{
await ReplyErrorLocalizedAsync("something_went_wrong").ConfigureAwait(false);
await ReplyErrorLocalizedAsync(strs.something_went_wrong).ConfigureAwait(false);
return;
}

View File

@@ -47,7 +47,7 @@ namespace NadekoBot.Modules.Games
if (!_service.HangmanGames.TryAdd(ctx.Channel.Id, hm))
{
hm.Dispose();
await ReplyErrorLocalizedAsync("hangman_running").ConfigureAwait(false);
await ReplyErrorLocalizedAsync(strs.hangman_running).ConfigureAwait(false);
return;
}
hm.OnGameEnded += Hm_OnGameEnded;
@@ -136,7 +136,7 @@ namespace NadekoBot.Modules.Games
if (_service.HangmanGames.TryRemove(ctx.Channel.Id, out var removed))
{
await removed.Stop().ConfigureAwait(false);
await ReplyConfirmLocalizedAsync("hangman_stopped").ConfigureAwait(false);
await ReplyConfirmLocalizedAsync(strs.hangman_stopped).ConfigureAwait(false);
}
}
}

View File

@@ -39,12 +39,12 @@ namespace NadekoBot.Modules.Games
return;
}
await ReplyConfirmLocalizedAsync("nunchi_joined", nunchi.ParticipantCount).ConfigureAwait(false);
await ReplyErrorLocalizedAsync(strs.nunchi_joined(nunchi.ParticipantCount));
return;
}
try { await ConfirmLocalizedAsync("nunchi_created").ConfigureAwait(false); } catch { }
try { await ConfirmLocalizedAsync(strs.nunchi_created); } catch { }
nunchi.OnGameEnded += Nunchi_OnGameEnded;
//nunchi.OnGameStarted += Nunchi_OnGameStarted;
@@ -58,7 +58,7 @@ namespace NadekoBot.Modules.Games
{
if (_service.NunchiGames.TryRemove(ctx.Guild.Id, out var game))
game.Dispose();
await ConfirmLocalizedAsync("nunchi_failed_to_start").ConfigureAwait(false);
await ConfirmLocalizedAsync(strs.nunchi_failed_to_start).ConfigureAwait(false);
}
Task _client_MessageReceived(SocketMessage arg)
@@ -90,36 +90,36 @@ namespace NadekoBot.Modules.Games
}
if (arg2 is null)
return ConfirmLocalizedAsync("nunchi_ended_no_winner", Format.Bold(arg2));
return ConfirmLocalizedAsync(strs.nunchi_ended_no_winner);
else
return ConfirmLocalizedAsync("nunchi_ended", Format.Bold(arg2));
return ConfirmLocalizedAsync(strs.nunchi_ended(Format.Bold(arg2)));
}
}
private Task Nunchi_OnRoundStarted(NunchiGame arg, int cur)
{
return ConfirmLocalizedAsync("nunchi_round_started",
return ConfirmLocalizedAsync(strs.nunchi_round_started(
Format.Bold(arg.ParticipantCount.ToString()),
Format.Bold(cur.ToString()));
Format.Bold(cur.ToString())));
}
private Task Nunchi_OnUserGuessed(NunchiGame arg)
{
return ConfirmLocalizedAsync("nunchi_next_number", Format.Bold(arg.CurrentNumber.ToString()));
return ConfirmLocalizedAsync(strs.nunchi_next_number(Format.Bold(arg.CurrentNumber.ToString())));
}
private Task Nunchi_OnRoundEnded(NunchiGame arg1, (ulong Id, string Name)? arg2)
{
if(arg2.HasValue)
return ConfirmLocalizedAsync("nunchi_round_ended", Format.Bold(arg2.Value.Name));
return ConfirmLocalizedAsync(strs.nunchi_round_ended(Format.Bold(arg2.Value.Name)));
else
return ConfirmLocalizedAsync("nunchi_round_ended_boot",
Format.Bold("\n" + string.Join("\n, ", arg1.Participants.Select(x => x.Name)))); // this won't work if there are too many users
return ConfirmLocalizedAsync(strs.nunchi_round_ended_boot(
Format.Bold("\n" + string.Join("\n, ", arg1.Participants.Select(x => x.Name))))); // this won't work if there are too many users
}
private Task Nunchi_OnGameStarted(NunchiGame arg)
{
return ConfirmLocalizedAsync("nunchi_started", Format.Bold(arg.ParticipantCount.ToString()));
return ConfirmLocalizedAsync(strs.nunchi_started(Format.Bold(arg.ParticipantCount.ToString())));
}
}
}

View File

@@ -36,8 +36,7 @@ namespace NadekoBot.Modules.Games
if (picked > 0)
{
var msg = await ReplyConfirmLocalizedAsync("picked", picked + CurrencySign)
.ConfigureAwait(false);
var msg = await ReplyConfirmLocalizedAsync(strs.picked(picked + CurrencySign));
msg.DeleteAfter(10);
}
@@ -67,7 +66,7 @@ namespace NadekoBot.Modules.Games
var success = await _service.PlantAsync(ctx.Guild.Id, ctx.Channel, ctx.User.Id, ctx.User.ToString(), amount, pass);
if (!success)
{
await ReplyErrorLocalizedAsync("not_enough", CurrencySign).ConfigureAwait(false);
await ReplyErrorLocalizedAsync(strs.not_enough( CurrencySign));
return;
}
@@ -89,11 +88,11 @@ namespace NadekoBot.Modules.Games
bool enabled = _service.ToggleCurrencyGeneration(ctx.Guild.Id, ctx.Channel.Id);
if (enabled)
{
await ReplyConfirmLocalizedAsync("curgen_enabled").ConfigureAwait(false);
await ReplyConfirmLocalizedAsync(strs.curgen_enabled).ConfigureAwait(false);
}
else
{
await ReplyConfirmLocalizedAsync("curgen_disabled").ConfigureAwait(false);
await ReplyConfirmLocalizedAsync(strs.curgen_disabled).ConfigureAwait(false);
}
}

View File

@@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Games
ctx.Channel.Id, arg);
if(poll is null)
{
await ReplyErrorLocalizedAsync("poll_invalid_input").ConfigureAwait(false);
await ReplyErrorLocalizedAsync(strs.poll_invalid_input).ConfigureAwait(false);
return;
}
if (_service.StartPoll(poll))
@@ -52,7 +52,7 @@ namespace NadekoBot.Modules.Games
}
else
{
await ReplyErrorLocalizedAsync("poll_already_running").ConfigureAwait(false);
await ReplyErrorLocalizedAsync(strs.poll_already_running).ConfigureAwait(false);
}
}

View File

@@ -44,7 +44,7 @@ namespace NadekoBot.Modules.Games
}
game = new TicTacToe(base.Strings, this._client, channel, (IGuildUser)ctx.User, options, _eb);
_service.TicTacToeGames.Add(channel.Id, game);
await ReplyConfirmLocalizedAsync("ttt_created").ConfigureAwait(false);
await ReplyConfirmLocalizedAsync(strs.ttt_created).ConfigureAwait(false);
game.OnEnded += (g) =>
{

View File

@@ -79,7 +79,7 @@ namespace NadekoBot.Modules.Games
return;
}
await ReplyErrorLocalizedAsync("trivia_none").ConfigureAwait(false);
await ReplyErrorLocalizedAsync(strs.trivia_none).ConfigureAwait(false);
}
[NadekoCommand, Aliases]
@@ -94,7 +94,7 @@ namespace NadekoBot.Modules.Games
return;
}
await ReplyErrorLocalizedAsync("trivia_none").ConfigureAwait(false);
await ReplyErrorLocalizedAsync(strs.trivia_none).ConfigureAwait(false);
}
}
}