mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
feat(i18n): localize all newly upgraded command embeds across 6 languages
- Add complete translations for en, ar-SA, ckb, tr, de-DE, and pt-BR - Localize author headers, fields, and footers for playnext, remove, move, and trackopt - Localize audio mastering fields for normalize and volumedefault - Localize Last.fm whoknows leaderboards and Crown Holder cards - Localize help command inspector and voice channel picker embeds - Ensure 0 missing keys and 100% translation coverage
This commit is contained in:
1 parent
8689dee50a
commit
63433816c4
16 files changed
+420
-120
No files matched your search
@@ -127,13 +127,13 @@ export async function runWhoknowsActions(msg, data, lastfm, prefix, userId, targ
|
||||
const top1 = listeners[0];
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setAuthor({ name: "👑 Server Music Leaderboard" })
|
||||
.setAuthor({ name: this.t(msg, "responses.lastfm.serverLeaderboardAuthor") })
|
||||
.setTitle(artistName)
|
||||
.setFooter({ text: `${listeners.length} listener${listeners.length !== 1 ? "s" : ""} • ${Utils.formatNumber(totalPlays)} total plays • %fm` });
|
||||
|
||||
if (top1) {
|
||||
embed.addFields({
|
||||
name: "👑 Crown Holder (#1)",
|
||||
name: this.t(msg, "responses.lastfm.crownHolder"),
|
||||
value: `**${top1.username}** — **${Utils.formatNumber(top1.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`,
|
||||
inline: false
|
||||
});
|
||||
@@ -429,22 +429,33 @@ export async function runWhoknowsActions(msg, data, lastfm, prefix, userId, targ
|
||||
return;
|
||||
}
|
||||
|
||||
const MEDALS = ["🥇", "🥈", "🥉"];
|
||||
const totalPlays = listeners.reduce((sum, l) => sum + l.playcount, 0);
|
||||
|
||||
const lines = listeners.map((l, i) => {
|
||||
const medal = i < 3 ? MEDALS[i] : ` `;
|
||||
return `${medal} ${i + 1}. **${l.username}** — **${Utils.formatNumber(l.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`;
|
||||
});
|
||||
|
||||
const desc = lines.join("\n").slice(0, 4096);
|
||||
const top1 = listeners[0];
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setTitle(this.t(msg, "responses.lastfm.whoknowsTrackTitle", { track: trackName }))
|
||||
.setDescription(desc)
|
||||
.setAuthor({ name: this.t(msg, "responses.lastfm.trackLeaderboardAuthor") })
|
||||
.setTitle(trackName + (artistName ? ` by ${artistName}` : ""))
|
||||
.setFooter({ text: this.t(msg, "responses.lastfm.whoknowsTrackFooter", { count: listeners.length, plural: listeners.length !== 1 ? "s" : "", totalPlays: Utils.formatNumber(totalPlays), artist: artistName }) });
|
||||
|
||||
if (top1) {
|
||||
embed.addFields({
|
||||
name: this.t(msg, "responses.lastfm.crownHolder"),
|
||||
value: `**${top1.username}** — **${Utils.formatNumber(top1.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`,
|
||||
inline: false
|
||||
});
|
||||
}
|
||||
|
||||
const rest = listeners.slice(1);
|
||||
if (rest.length > 0) {
|
||||
const lines = rest.map((l, i) => {
|
||||
const rank = i + 2;
|
||||
const medal = rank === 2 ? "🥈" : rank === 3 ? "🥉" : `\`#${rank}\``;
|
||||
return `${medal} **${l.username}** — **${Utils.formatNumber(l.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`;
|
||||
});
|
||||
embed.setDescription(lines.join("\n").slice(0, 4096));
|
||||
}
|
||||
|
||||
const replyPayload = { embeds: [embed] };
|
||||
if (statusMsg) statusMsg.edit(replyPayload).catch(() => msg.reply(replyPayload));
|
||||
else msg.reply(replyPayload);
|
||||
@@ -510,22 +521,33 @@ export async function runWhoknowsActions(msg, data, lastfm, prefix, userId, targ
|
||||
return;
|
||||
}
|
||||
|
||||
const MEDALS = ["🥇", "🥈", "🥉"];
|
||||
const totalPlays = listeners.reduce((sum, l) => sum + l.playcount, 0);
|
||||
|
||||
const lines = listeners.map((l, i) => {
|
||||
const medal = i < 3 ? MEDALS[i] : ` `;
|
||||
return `${medal} ${i + 1}. **${l.username}** — **${Utils.formatNumber(l.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`;
|
||||
});
|
||||
|
||||
const desc = lines.join("\n").slice(0, 4096);
|
||||
const top1 = listeners[0];
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setTitle(this.t(msg, "responses.lastfm.whoknowsAlbumTitle", { album: albumName }))
|
||||
.setDescription(desc)
|
||||
.setAuthor({ name: this.t(msg, "responses.lastfm.albumLeaderboardAuthor") })
|
||||
.setTitle(albumName + (artistName ? ` by ${artistName}` : ""))
|
||||
.setFooter({ text: this.t(msg, "responses.lastfm.whoknowsFooter", { count: listeners.length, plural: listeners.length !== 1 ? "s" : "", totalPlays: Utils.formatNumber(totalPlays) }) });
|
||||
|
||||
if (top1) {
|
||||
embed.addFields({
|
||||
name: this.t(msg, "responses.lastfm.crownHolder"),
|
||||
value: `**${top1.username}** — **${Utils.formatNumber(top1.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`,
|
||||
inline: false
|
||||
});
|
||||
}
|
||||
|
||||
const rest = listeners.slice(1);
|
||||
if (rest.length > 0) {
|
||||
const lines = rest.map((l, i) => {
|
||||
const rank = i + 2;
|
||||
const medal = rank === 2 ? "🥈" : rank === 3 ? "🥉" : `\`#${rank}\``;
|
||||
return `${medal} **${l.username}** — **${Utils.formatNumber(l.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`;
|
||||
});
|
||||
embed.setDescription(lines.join("\n").slice(0, 4096));
|
||||
}
|
||||
|
||||
const replyPayload = { embeds: [embed] };
|
||||
if (statusMsg) statusMsg.edit(replyPayload).catch(() => msg.reply(replyPayload));
|
||||
else msg.reply(replyPayload);
|
||||
|
||||
Reference in new issue
Block a user