WIP: rework of localized strings, instead of generic LocStr, LocStr is now a struct which contains both the key, and the values which should be put into the value's placeholders. strs' properties are now methods which take values as arguments, and properties if they don't

This commit is contained in:
Kwoth
2021-07-26 20:08:02 +02:00
parent 9d375dccee
commit 0115d35247
46 changed files with 176 additions and 273 deletions

View File

@@ -293,10 +293,10 @@ namespace NadekoBot.Modules.Music
var repeatType = mp.Repeat;
var add = "";
if (mp.IsStopped)
add += Format.Bold(GetText(strs.queue_stopped, Format.Code(Prefix + "play"))) + "\n";
add += Format.Bold(GetText(strs.queue_stopped(Format.Code(Prefix + "play")))) + "\n";
// var mps = mp.MaxPlaytimeSeconds;
// if (mps > 0)
// add += Format.Bold(GetText(strs.song_skips_after, TimeSpan.FromSeconds(mps).ToString("HH\\:mm\\:ss"))) + "\n";
// add += Format.Bold(GetText(strs.song_skips_after(TimeSpan.FromSeconds(mps).ToString("HH\\:mm\\:ss")))) + "\n";
if (repeatType == PlayerRepeatType.Track)
{
add += "🔂 " + GetText(strs.repeating_track) + "\n";
@@ -329,7 +329,7 @@ namespace NadekoBot.Modules.Music
desc = add + "\n" + desc;
var embed = _eb.Create()
.WithAuthor(GetText(strs.player_queue, curPage + 1, (tracks.Count / LQ_ITEMS_PER_PAGE) + 1),
.WithAuthor(GetText(strs.player_queue(curPage + 1, (tracks.Count / LQ_ITEMS_PER_PAGE) + 1)),
MusicIconUrl)
.WithDescription(desc)
.WithFooter($" {mp.PrettyVolume()} | 🎶 {tracks.Count} | ⌛ {mp.PrettyTotalTime()} ")

View File

@@ -63,9 +63,9 @@ namespace NadekoBot.Modules.Music
var embed = _eb
.Create(ctx)
.WithAuthor(GetText(strs.playlists_page, num), MusicIconUrl)
.WithAuthor(GetText(strs.playlists_page(num), MusicIconUrl))
.WithDescription(string.Join("\n", playlists.Select(r =>
GetText(strs.playlists, r.Id, r.Name, r.Author, r.Songs.Count))))
GetText(strs.playlists(r.Id, r.Name, r.Author, r.Songs.Count)))))
.WithOkColor();
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
@@ -225,7 +225,7 @@ namespace NadekoBot.Modules.Music
try
{
msg = await ctx.Channel
.SendMessageAsync(GetText(strs.attempting_to_queue, Format.Bold(mpl.Songs.Count.ToString())))
.SendMessageAsync(GetText(strs.attempting_to_queue(Format.Bold(mpl.Songs.Count.ToString()))))
.ConfigureAwait(false);
}
catch (Exception)