wip strings rework, experimenting, nothing works

This commit is contained in:
Kwoth
2021-07-25 19:25:48 +02:00
parent 70288f7670
commit 9d375dccee
53 changed files with 211 additions and 187 deletions

View File

@@ -55,7 +55,7 @@ namespace NadekoBot.Modules.Utility
"GetHashCode",
"GetType"
});
await SendConfirmAsync(GetText("calcops", Prefix), string.Join(", ", selection)).ConfigureAwait(false);
await SendConfirmAsync(GetText(strs.calcops, Prefix), string.Join(", ", selection)).ConfigureAwait(false);
}
}

View File

@@ -52,7 +52,7 @@ namespace NadekoBot.Modules.Utility
var configNames = _settingServices.Select(x => x.Name);
var embed = _eb.Create()
.WithErrorColor()
.WithDescription(GetText("config_not_found", Format.Code(name)))
.WithDescription(GetText(strs.config_not_found, Format.Code(name)))
.AddField(GetText(strs.config_list), string.Join("\n", configNames));
await ctx.Channel.EmbedAsync(embed);
@@ -90,7 +90,7 @@ namespace NadekoBot.Modules.Utility
{
var embed = _eb.Create()
.WithErrorColor()
.WithDescription(GetText("config_not_found", Format.Code(name)))
.WithDescription(GetText(strs.config_not_found, Format.Code(name)))
.AddField(GetText(strs.config_list), string.Join("\n", configNames));
await ctx.Channel.EmbedAsync(embed);
@@ -123,7 +123,7 @@ namespace NadekoBot.Modules.Utility
var propStrings = GetPropsAndValuesString(setting, propNames);
var propErrorEmbed = _eb.Create()
.WithErrorColor()
.WithDescription(GetText("config_prop_not_found", Format.Code(prop), Format.Code(name)))
.WithDescription(GetText(strs.config_prop_not_found, Format.Code(prop), Format.Code(name)))
.AddField($"⚙️ {setting.Name}", propStrings);
await ctx.Channel.EmbedAsync(propErrorEmbed);

View File

@@ -135,16 +135,16 @@ namespace NadekoBot.Modules.Utility
StringBuilder str = new StringBuilder();
foreach (var kvp in CmdHandler.UserMessagesSent.OrderByDescending(kvp => kvp.Value).Skip(page * activityPerPage).Take(activityPerPage))
{
str.AppendLine(GetText("activity_line",
str.AppendLine(GetText(strs.activity_line,
++startCount,
Format.Bold(kvp.Key.ToString()),
kvp.Value / _stats.GetUptime().TotalSeconds, kvp.Value));
}
await ctx.Channel.EmbedAsync(_eb.Create()
.WithTitle(GetText("activity_page", page + 1))
.WithTitle(GetText(strs.activity_page, page + 1))
.WithOkColor()
.WithFooter(GetText("activity_users_total", CmdHandler.UserMessagesSent.Count))
.WithFooter(GetText(strs.activity_users_total, CmdHandler.UserMessagesSent.Count))
.WithDescription(str.ToString())).ConfigureAwait(false);
}
}

View File

@@ -99,7 +99,7 @@ namespace NadekoBot.Modules.Utility
var inv = invites.ElementAt(index);
await inv.DeleteAsync().ConfigureAwait(false);
await ReplyAsync(GetText("invite_deleted", Format.Bold(inv.Code.ToString()))).ConfigureAwait(false);
await ReplyAsync(GetText(strs.invite_deleted, Format.Bold(inv.Code.ToString()))).ConfigureAwait(false);
}
}
}

View File

@@ -41,8 +41,8 @@ namespace NadekoBot.Modules.Utility
.AddField(GetText(strs.clpa_fail_already_title), GetText(strs.clpa_fail_already))
.AddField(GetText(strs.clpa_fail_wait_title), GetText(strs.clpa_fail_wait))
.AddField(GetText(strs.clpa_fail_conn_title), GetText(strs.clpa_fail_conn))
.AddField(GetText(strs.clpa_fail_sup_title), GetText("clpa_fail_sup", helpcmd))
.WithFooter(GetText("clpa_next_update", rem)));
.AddField(GetText(strs.clpa_fail_sup_title), GetText(strs.clpa_fail_sup, helpcmd))
.WithFooter(GetText(strs.clpa_next_update, rem)));
}
}
}

View File

@@ -48,7 +48,7 @@ namespace NadekoBot.Modules.Utility
}
if (quotes.Any())
await SendConfirmAsync(GetText("quotes_page", page + 1),
await SendConfirmAsync(GetText(strs.quotes_page, page + 1),
string.Join("\n", quotes.Select(q => $"`#{q.Id}` {Format.Bold(q.Keyword.SanitizeAllMentions()),-20} by {q.AuthorName.SanitizeAllMentions()}")))
.ConfigureAwait(false);
else
@@ -113,12 +113,12 @@ namespace NadekoBot.Modules.Utility
{
await ctx.Channel.EmbedAsync(_eb.Create(ctx)
.WithOkColor()
.WithTitle(GetText("quote_id", $"#{data.Id}"))
.WithTitle(GetText(strs.quote_id, $"#{data.Id}"))
.AddField(GetText(strs.trigger), data.Keyword)
.AddField(GetText(strs.response), data.Text.Length > 1000
? GetText(strs.redacted_too_long)
: Format.Sanitize(data.Text))
.WithFooter(GetText("created_by", $"{data.AuthorName} ({data.AuthorId})"))
.WithFooter(GetText(strs.created_by, $"{data.AuthorName} ({data.AuthorId})"))
).ConfigureAwait(false);
}
@@ -222,7 +222,7 @@ namespace NadekoBot.Modules.Utility
uow.Quotes.Remove(q);
await uow.SaveChangesAsync();
success = true;
response = GetText("quote_deleted", id);
response = GetText(strs.quote_deleted, id);
}
}
if (success)

View File

@@ -190,7 +190,7 @@ namespace NadekoBot.Modules.Utility
try
{
await SendConfirmAsync(
"⏰ " + GetText("remind",
"⏰ " + GetText(strs.remind,
Format.Bold(!isPrivate ? $"<#{targetId}>" : ctx.User.Username),
Format.Bold(message),
$"{ts.Days}d {ts.Hours}h {ts.Minutes}min",

View File

@@ -50,7 +50,7 @@ namespace NadekoBot.Modules.Utility
var description = GetRepeaterInfoString(removed);
await ctx.Channel.EmbedAsync(_eb.Create()
.WithOkColor()
.WithTitle(GetText("repeater_removed", index + 1))
.WithTitle(GetText(strs.repeater_removed, index + 1))
.WithDescription(description));
}

View File

@@ -89,7 +89,7 @@ namespace NadekoBot.Modules.Utility
}
res = Math.Round(res, 4);
await SendConfirmAsync(GetText("convert", value, originUnit.Triggers.Last(), res, targetUnit.Triggers.Last())).ConfigureAwait(false);
await SendConfirmAsync(GetText(strs.convert, value, originUnit.Triggers.Last(), res, targetUnit.Triggers.Last())).ConfigureAwait(false);
}
}
}

View File

@@ -117,7 +117,7 @@ namespace NadekoBot.Modules.Utility
return _eb.Create().WithOkColor().WithDescription(GetText(strs.no_user_on_this_page));
return _eb.Create().WithOkColor()
.WithTitle(GetText("inrole_list", Format.Bold(role?.Name ?? "No Role")) + $" - {roleUsers.Length}")
.WithTitle(GetText(strs.inrole_list, Format.Bold(role?.Name ?? "No Role")) + $" - {roleUsers.Length}")
.WithDescription(string.Join("\n", pageUsers));
}, roleUsers.Length, 20).ConfigureAwait(false);
}
@@ -199,7 +199,7 @@ namespace NadekoBot.Modules.Utility
else
{
await SendConfirmAsync(GetText("roles_page", page, Format.Bold(target.ToString())),
await SendConfirmAsync(GetText(strs.roles_page, page, Format.Bold(target.ToString())),
"\n• " + string.Join("\n• ", (IEnumerable<IRole>)roles).SanitizeMentions(true)).ConfigureAwait(false);
}
}
@@ -212,7 +212,7 @@ namespace NadekoBot.Modules.Utility
}
else
{
await SendConfirmAsync(GetText("roles_all_page", page),
await SendConfirmAsync(GetText(strs.roles_all_page, page),
"\n• " + string.Join("\n• ", (IEnumerable<IRole>)roles).SanitizeMentions(true)).ConfigureAwait(false);
}
}
@@ -259,7 +259,7 @@ namespace NadekoBot.Modules.Utility
.AddField(GetText(strs.owner_ids), ownerIds, true)
.AddField(GetText(strs.uptime), _stats.GetUptimeString("\n"), true)
.AddField(GetText(strs.presence),
GetText("presence_txt",
GetText(strs.presence_txt,
_coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels), true))
.ConfigureAwait(false);
}
@@ -269,7 +269,7 @@ namespace NadekoBot.Modules.Utility
{
var tags = ctx.Message.Tags.Where(t => t.Type == TagType.Emoji).Select(t => (Emote)t.Value);
var result = string.Join("\n", tags.Select(m => GetText("showemojis", m, m.Url)));
var result = string.Join("\n", tags.Select(m => GetText(strs.showemojis, m, m.Url)));
if (string.IsNullOrWhiteSpace(result))
await ReplyErrorLocalizedAsync("showemojis_none").ConfigureAwait(false);
@@ -298,7 +298,7 @@ namespace NadekoBot.Modules.Utility
.WithOkColor();
foreach (var guild in guilds)
embed.AddField(guild.Name,
GetText("listservers", guild.Id, guild.MemberCount, guild.OwnerId),
GetText(strs.listservers, guild.Id, guild.MemberCount, guild.OwnerId),
false);
await ctx.Channel.EmbedAsync(embed);