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:
NoLogicAlan committed 2026-10-25 04:03:33 +03:00
1 parent 8689dee50a
commit 63433816c4
16 files changed
+420 -120

No files matched your search

+18 -6
View File
@@ -4,7 +4,8 @@
*/
import { CommandBuilder } from "../src/commands/index.mjs";
import { cleanId } from "../src/ui/index.mjs";
import { EmbedBuilder } from "@fluxerjs/core";
import { cleanId, getGlobalColor } from "../src/ui/index.mjs";
import { resolveChannelCached } from "../src/utils/Helpers247.mjs";
/**
@@ -35,12 +36,23 @@ export const command = new CommandBuilder()
export async function run(msg, data) {
const cid = cleanId(data.get("channelId").value);
const targetChannel = await resolveChannelCached(this.client, cid);
if (!targetChannel) return msg.reply(this.t(msg, "responses.forceleave.channelNotFound"));
if (cleanId(msg.message?.guildId) !== cleanId(targetChannel.guildId))
return msg.reply(this.t(msg, "responses.forceleave.wrongServer"));
if (!targetChannel) {
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(msg, "responses.forceleave.channelNotFound"));
return msg.reply({ embeds: [embed] });
}
if (cleanId(msg.message?.guildId) !== cleanId(targetChannel.guildId)) {
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(msg, "responses.forceleave.wrongServer"));
return msg.reply({ embeds: [embed] });
}
const p = this.players.playerMap.get(cid)
?? [...this.players.playerMap.values()].find((player) => cleanId(player?._channelId) === cid);
if (!p) return msg.reply(this.t(msg, "responses.forceleave.playerNotFound"));
if (!p.connection) return msg.reply(this.t(msg, "responses.forceleave.playerNotInit"));
if (!p) {
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(msg, "responses.forceleave.playerNotFound"));
return msg.reply({ embeds: [embed] });
}
if (!p.connection) {
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(msg, "responses.forceleave.playerNotInit"));
return msg.reply({ embeds: [embed] });
}
await this.players.leave(msg, cid);
}
+44 -22
View File
@@ -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);
+4 -3
View File
@@ -37,6 +37,7 @@ export async function run(message, data) {
if (!p) return;
const from = data.get("from")?.value;
const to = data.get("to")?.value;
const prefix = this.handler?.getPrefix?.(message.message?.guildId ?? message.channel?.guildId) ?? "%";
if (from === null || from === undefined || from < 1) return message.replyEmbed("Source position must be 1 or greater.").catch(() => {});
if (to === null || to === undefined || to < 1) return message.replyEmbed("Target position must be 1 or greater.").catch(() => {});
@@ -49,10 +50,10 @@ export async function run(message, data) {
const embed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: "🔀 Track Reordered" })
.setAuthor({ name: this.t(message, "responses.move.reorderedAuthor") })
.setTitle(track?.title?.slice(0, 256) || "Reordered Track")
.setDescription(`Moved from position **#${from}** ➔ **#${to}** in the queue.`)
.setFooter({ text: to === 1 ? "Now playing next after the current song • %np" : "%list to view updated queue" });
.setDescription(this.t(message, "responses.move.reorderedDesc", { from, to }))
.setFooter({ text: to === 1 ? this.t(message, "responses.move.nowPlayingNext", { prefix }) : this.t(message, "responses.move.viewUpdatedQueue", { prefix }) });
if (track?.thumbnail) embed.setThumbnail(track.thumbnail);
message.reply({ embeds: [embed] }).catch(() => {});
+6 -6
View File
@@ -67,9 +67,9 @@ export async function run(message, data) {
const embed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: "🎚️ Dynamic Loudness Normalization" })
.setTitle("EBU R128 Audio Leveling")
.setFooter({ text: "Balances volume differences across YouTube, Spotify & SoundCloud" });
.setAuthor({ name: this.t(message, "responses.normalize.headerAuthor") })
.setTitle(this.t(message, "responses.normalize.headerTitle"))
.setFooter({ text: this.t(message, "responses.normalize.footer") });
const statusMsg = newState
? this.t(message, "responses.normalize.statusEnabled")
@@ -87,9 +87,9 @@ export async function run(message, data) {
const gainSign = gain >= 1 ? "+" : "";
embed.addFields(
{ name: "Track Source", value: source || "Default", inline: true },
{ name: "Gain Offset", value: `${gainSign}${gainDb} dB (${(gain * 100).toFixed(0)}%)`, inline: true },
{ name: "Effective Volume", value: `${Math.round(p.getEffectiveVolume())}%`, inline: true }
{ name: this.t(message, "responses.normalize.fieldSource"), value: source || "Default", inline: true },
{ name: this.t(message, "responses.normalize.fieldGainOffset"), value: `${gainSign}${gainDb} dB (${(gain * 100).toFixed(0)}%)`, inline: true },
{ name: this.t(message, "responses.normalize.fieldEffectiveVolume"), value: `${Math.round(p.getEffectiveVolume())}%`, inline: true }
);
}
}
+1 -1
View File
@@ -82,7 +82,7 @@ export async function run(message, data) {
/* Set Playing Next author tag on the added track embed */
const authorName = embed.data?.author?.name || "";
if (authorName.includes("Added to Queue") || !authorName) {
embed.setAuthor({ name: "⚡ Playing Next • Top of Queue (#1)" });
embed.setAuthor({ name: this.t(message, "responses.playnext.playingNext") });
}
if (statusMsg) statusMsg.edit({ embeds: [embed] }).catch(() => {});
+8 -7
View File
@@ -29,6 +29,7 @@ export async function run(message, data) {
const p = await this.getPlayer(message, false, false, false);
if (!p) return;
const raw = String(data.get("position")?.value ?? "").trim();
const prefix = this.handler?.getPrefix?.(message.message?.guildId ?? message.channel?.guildId) ?? "%";
if (!raw) return message.replyEmbed("Please provide a queue position or range (e.g. `3` or `3-6`).").catch(() => {});
const rangeMatch = raw.match(/^(\d+)\s*[-–—to:]+\s*(\d+)$/i) || raw.match(/^(\d+)\s+(\d+)$/);
@@ -44,10 +45,10 @@ export async function run(message, data) {
const count = Math.abs(to - from) + 1;
const embed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: "🗑️ Removed from Queue" })
.setTitle(`Removed ${count} Tracks`)
.setDescription(`Successfully removed positions **#${Math.min(from, to)}** to **#${Math.max(from, to)}** from the queue.`)
.setFooter({ text: `${remaining} track${remaining === 1 ? "" : "s"} remaining in queue • %list` });
.setAuthor({ name: this.t(message, "responses.remove.removedAuthor") })
.setTitle(this.t(message, "responses.remove.removedRangeTitle", { count }))
.setDescription(this.t(message, "responses.remove.removedRangeDesc", { from: Math.min(from, to), to: Math.max(from, to) }))
.setFooter({ text: this.t(message, "responses.remove.remainingFooter", { count: remaining, plural: remaining === 1 ? "" : "s", prefix }) });
return message.reply({ embeds: [embed] }).catch(() => {});
}
@@ -62,10 +63,10 @@ export async function run(message, data) {
const remaining = p.queue?.size() ?? 0;
const embed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: "🗑️ Removed from Queue" })
.setAuthor({ name: this.t(message, "responses.remove.removedAuthor") })
.setTitle(track?.title?.slice(0, 256) || "Removed Track")
.setDescription(`Removed track at position **#${single}** from the queue.`)
.setFooter({ text: `${remaining} track${remaining === 1 ? "" : "s"} remaining in queue • %list` });
.setDescription(this.t(message, "responses.remove.removedSingleDesc", { position: single }))
.setFooter({ text: this.t(message, "responses.remove.remainingFooter", { count: remaining, plural: remaining === 1 ? "" : "s", prefix }) });
if (track?.thumbnail) embed.setThumbnail(track.thumbnail);
return message.reply({ embeds: [embed] }).catch(() => {});
}
+9 -9
View File
@@ -184,7 +184,7 @@ export async function run(msg, data) {
const timeline = buildTimelineBar(startMs, endMs, trackDuration);
const setEmbed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: "✂️ Custom Track Trim Saved" })
.setAuthor({ name: this.t(msg, "responses.trackopt.savedAuthor") })
.setTitle(current.title?.slice(0, 256) || "Track Trim")
.setDescription(
result.alias === DEFAULT_ALIAS
@@ -192,14 +192,14 @@ export async function run(msg, data) {
: this.t(msg, "responses.trackopt.savedAlias", { title: current.title, alias: result.alias, start: Utils.prettifyMS(startMs), end: endLabel, prefix })
)
.addFields(
{ name: "Playback Window", value: timeline, inline: false },
{ name: "Alias", value: `\`${result.alias}\``, inline: true },
{ name: "Active Trim", value: `${Utils.prettifyMS(startMs)} ➔ ${endLabel}`, inline: true }
{ name: this.t(msg, "responses.trackopt.playbackWindowField"), value: timeline, inline: false },
{ name: this.t(msg, "responses.trackopt.aliasField"), value: `\`${result.alias}\``, inline: true },
{ name: this.t(msg, "responses.trackopt.activeTrimField"), value: `${Utils.prettifyMS(startMs)} ➔ ${endLabel}`, inline: true }
);
if (current.thumbnail) setEmbed.setThumbnail(current.thumbnail);
if (result.alias !== DEFAULT_ALIAS) {
setEmbed.setFooter({ text: `Play this cut anytime with: ${prefix}trackopt play ${result.alias}` });
setEmbed.setFooter({ text: this.t(msg, "responses.trackopt.playHintFooter", { prefix, alias: result.alias }) });
}
return msg.reply({ embeds: [setEmbed] });
@@ -214,9 +214,9 @@ export async function run(msg, data) {
const trackDuration = p._getTrackDurationMs(current);
const getEmbed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: "✂️ Saved Track Trims" })
.setAuthor({ name: this.t(msg, "responses.trackopt.savedListAuthor") })
.setTitle(current.title?.slice(0, 256) || "Track Trims")
.setFooter({ text: `${rows.length} trim profile${rows.length === 1 ? "" : "s"} saved • Apply with ${prefix}trackopt play <alias>` });
.setFooter({ text: this.t(msg, "responses.trackopt.trimProfilesFooter", { count: rows.length, plural: rows.length === 1 ? "" : "s", prefix }) });
if (current.thumbnail) getEmbed.setThumbnail(current.thumbnail);
@@ -272,10 +272,10 @@ export async function run(msg, data) {
const playEmbed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: "✂️ Track Trim Applied" })
.setAuthor({ name: this.t(msg, "responses.trackopt.appliedAuthor") })
.setTitle(current.title?.slice(0, 256) || "Track Trim")
.setDescription(this.t(msg, "responses.trackopt.applied", { alias: aliasLabel, start: Utils.prettifyMS(result.startMs), end: endStr }))
.addFields({ name: "Active Cut Range", value: timeline, inline: false });
.addFields({ name: this.t(msg, "responses.trackopt.activeCutRangeField"), value: timeline, inline: false });
if (current.thumbnail) playEmbed.setThumbnail(current.thumbnail);
+5 -5
View File
@@ -70,7 +70,7 @@ export async function run(message, data) {
const currentPlayerVol = Math.round((p.preferredVolume ?? 1) * 100);
const pfx = this.handler.getPrefix(message.channel?.guildId ?? message.message?.guildId);
embed
.setAuthor({ name: "🔊 Server Default Volume" })
.setAuthor({ name: this.t(message, "responses.volumedefault.author") })
.setTitle(this.t(message, "responses.volumedefault.title"))
.setDescription(
hasManage
@@ -78,8 +78,8 @@ export async function run(message, data) {
: this.t(message, "responses.volumedefault.noPermission")
)
.addFields(
{ name: "Default Volume", value: buildVolumeSlider(currentDefault), inline: false },
{ name: "Active Session Volume", value: `${currentPlayerVol}%`, inline: true }
{ name: this.t(message, "responses.volumedefault.fieldDefault"), value: buildVolumeSlider(currentDefault), inline: false },
{ name: this.t(message, "responses.volumedefault.fieldActive"), value: `${currentPlayerVol}%`, inline: true }
);
} else if (!hasManage) {
embed.setDescription(this.t(message, "responses.volumedefault.noPermissionSet"));
@@ -91,9 +91,9 @@ export async function run(message, data) {
p.setVolume(pct / 100);
if (set) set.set("volume", pct);
embed
.setAuthor({ name: "🔊 Server Default Volume Saved" })
.setAuthor({ name: this.t(message, "responses.volumedefault.authorSaved") })
.setDescription(this.t(message, "responses.volumedefault.saved", { volume: pct }))
.addFields({ name: "New Default Level", value: buildVolumeSlider(pct), inline: false });
.addFields({ name: this.t(message, "responses.volumedefault.fieldNewDefault"), value: buildVolumeSlider(pct), inline: false });
}
}