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

+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;