Second iteration of source generated localized strings

- Strs renamed to strs
- Generic params will now default to object instead of string for convenient argument passing
- Many strings changed to use generated properties
This commit is contained in:
Kwoth
2021-07-24 20:41:07 +02:00
parent 34d0f66466
commit 70288f7670
63 changed files with 410 additions and 363 deletions

View File

@@ -114,8 +114,8 @@ namespace NadekoBot.Modules.Music
{
var embed = _eb.Create()
.WithOkColor()
.WithAuthor(GetText("queued_song") + " #" + (index + 1), MusicIconUrl)
.WithDescription($"{trackInfo.PrettyName()}\n{GetText("queue")} ")
.WithAuthor(GetText(strs.queued_song) + " #" + (index + 1), MusicIconUrl)
.WithDescription($"{trackInfo.PrettyName()}\n{GetText(strs.queue)} ")
.WithFooter(trackInfo.Platform.ToString());
if (!string.IsNullOrWhiteSpace(trackInfo.Thumbnail))
@@ -299,16 +299,16 @@ namespace NadekoBot.Modules.Music
// add += Format.Bold(GetText("song_skips_after", TimeSpan.FromSeconds(mps).ToString("HH\\:mm\\:ss"))) + "\n";
if (repeatType == PlayerRepeatType.Track)
{
add += "🔂 " + GetText("repeating_track") + "\n";
add += "🔂 " + GetText(strs.repeating_track) + "\n";
}
else
{
// if (mp.Autoplay)
// add += "↪ " + GetText("autoplaying") + "\n";
// add += "↪ " + GetText(strs.autoplaying) + "\n";
// if (mp.FairPlay && !mp.Autoplay)
// add += " " + GetText("fairplay") + "\n";
// add += " " + GetText(strs.fairplay) + "\n";
if (repeatType == PlayerRepeatType.Queue)
add += "🔁 " + GetText("repeating_queue") + "\n";
add += "🔁 " + GetText(strs.repeating_queue) + "\n";
}
@@ -431,7 +431,7 @@ namespace NadekoBot.Modules.Music
}
var embed = _eb.Create()
.WithAuthor(GetText("removed_song") + " #" + (index), MusicIconUrl)
.WithAuthor(GetText(strs.removed_song) + " #" + (index), MusicIconUrl)
.WithDescription(song.PrettyName())
.WithFooter(song.PrettyInfo())
.WithErrorColor();
@@ -615,9 +615,9 @@ namespace NadekoBot.Modules.Music
var embed = _eb.Create()
.WithTitle(track.Title.TrimTo(65))
.WithAuthor(GetText("song_moved"), MusicIconUrl)
.AddField(GetText("from_position"), $"#{from + 1}", true)
.AddField(GetText("to_position"), $"#{to + 1}", true)
.WithAuthor(GetText(strs.song_moved), MusicIconUrl)
.AddField(GetText(strs.from_position), $"#{from + 1}", true)
.AddField(GetText(strs.to_position), $"#{to + 1}", true)
.WithOkColor();
if (Uri.IsWellFormedUriString(track.Url, UriKind.Absolute))
@@ -702,7 +702,7 @@ namespace NadekoBot.Modules.Music
return;
var embed = _eb.Create().WithOkColor()
.WithAuthor(GetText("now_playing"), MusicIconUrl)
.WithAuthor(GetText(strs.now_playing), MusicIconUrl)
.WithDescription(currentTrack.PrettyName())
.WithThumbnailUrl(currentTrack.Thumbnail)
.WithFooter($"{mp.PrettyVolume()} | {mp.PrettyTotalTime()} | {currentTrack.Platform} | {currentTrack.Queuer}");

View File

@@ -166,9 +166,9 @@ namespace NadekoBot.Modules.Music
await ctx.Channel.EmbedAsync(_eb.Create()
.WithOkColor()
.WithTitle(GetText("playlist_saved"))
.AddField(GetText("name"), name)
.AddField(GetText("id"), playlist.Id.ToString()));
.WithTitle(GetText(strs.playlist_saved))
.AddField(GetText(strs.name), name)
.AddField(GetText(strs.id), playlist.Id.ToString()));
}
@@ -239,7 +239,7 @@ namespace NadekoBot.Modules.Music
if (msg != null)
{
await msg.ModifyAsync(m => m.Content = GetText("playlist_queue_complete"));
await msg.ModifyAsync(m => m.Content = GetText(strs.playlist_queue_complete));
}
}
finally