i18n: replace hardcoded strings with locale keys across all commands

- Add locale keys for gateway/MessageHandler permission error messages
- Add locale support to settings command (prettifySettingLabel now accepts t/guildId)
- Replace all hardcoded strings in player, search, seek, trackopt, vote, autoplay, debug, lastfm commands with this.t() calls
- Add new locale keys: command suggestions, vote descriptions, debug pagination, lastfm auth/link/profile/whoknows/leaderboard/playlists/artists strings
- Fix typos in en.json: broken backtick in alreadyLinked, extra $ in unlovedTrack artist template
- Add new locale key for command suggestion ("Did you mean...?")
- Remove "React to refresh" suffix from controls expired footer (now just uses locale key)
This commit is contained in:
NoLogicAlan committed 2026-05-25 20:47:58 +03:00
1 parent b581722c46
commit eeb27de9bb
19 files changed
+1476 -5862

No files matched your search

+4 -3
View File
@@ -137,10 +137,11 @@ export class GatewayHandler {
} catch (e) {
logger.warn(`[GuildCreate] Cannot send permission warning to server ${guildId}: ${e.message}`);
try {
const t = this.remix.locale?.translate?.bind(this.remix.locale);
const guildIdStr = String(guildId).replace(/\D/g, "");
await targetChannel.send(
"⚠️ I'm missing permissions I need to work properly! " +
"Missing: **" + missingNames.join("**, **") + "**. " +
"Please ask a server administrator to grant these permissions in Server Settings → Roles."
t ? t(guildIdStr, "responses.gateway.missingPermsFallback", { perms: missingNames.join("**, **") }) :
"⚠️ I'm missing permissions I need to work properly! Missing: **" + missingNames.join("**, **") + "**. Please ask a server administrator to grant these permissions in Server Settings → Roles."
);
} catch (_) {
logger.warn(`[GuildCreate] Cannot send ANY notification to server ${guildId} — bot is missing SendMessages permission.`);
+6 -8
View File
@@ -176,24 +176,22 @@ export class MessageHandler {
const embed = new EmbedBuilder().setColor(0xFF4444);
if (criticalItems.length > 0) {
embed.setTitle("Missing Permissions — Bot Cannot Work Properly");
embed.setTitle(this.t(guildId, "responses.messages.missingCriticalPermsTitle"));
embed.setDescription(
"The bot is missing **critical permissions** it needs to function. " +
"Please ask a server administrator to grant them.\n\n" +
this.t(guildId, "responses.messages.missingCriticalPermsDesc") + "\n\n" +
criticalItems.join("\n")
);
} else if (optionalItems.length > 0) {
embed.setTitle("Missing Optional Permissions");
embed.setTitle(this.t(guildId, "responses.messages.missingOptionalPermsTitle"));
embed.setDescription(
"Some features may not work without these permissions, but the bot can still play music.\n\n" +
this.t(guildId, "responses.messages.missingOptionalPermsDesc") + "\n\n" +
optionalItems.join("\n")
);
embed.setColor(0xFFA500);
}
embed.setFooter({
text: "Re-invite the bot with correct permissions using the invite link, " +
"or edit the bot's role in Server Settings → Roles."
text: this.t(guildId, "responses.messages.permFooter")
});
return embed;
@@ -231,7 +229,7 @@ export class MessageHandler {
logger.warn("[MessageHandler] Failed to send permission embed:", e.message);
try {
const names = missing.map(k => REQUIRED_BOT_PERMISSIONS.get(k)?.name ?? k);
await message.reply("I need the following permissions: **" + names.join("**, **") + "**. Please ask a server admin to grant them.", { ping: false });
await message.reply(this.t(message.guildId, "responses.messages.needPermsFallback", { perms: names.join("** **") }), { ping: false });
} catch (_) { /* completely blocked */ }
}
return false;
+1 -1
View File
@@ -125,7 +125,7 @@ export class Dashboard {
*/
setBotId(botId) {
if (!this.enabled || !this.redis) return;
this.redis.platform = `fluxer`;
this.redis.platform = `fluxer_${botId}`;
}