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

+17 -6
View File
@@ -385,8 +385,20 @@ function format247Summary(set, t, guildId) {
return lines.join("\n");
}
function prettifySettingLabel(key) {
const custom = {
function prettifySettingLabel(key, t, guildId) {
const localeMap = {
songAnnouncements: "responses.settings.labelSongAnnouncements",
prefix: "responses.settings.labelPrefix",
pfx: "responses.settings.labelPfp",
locale: "responses.settings.labelLocale",
stay_247: "responses.settings.label247",
volume: "responses.settings.labelVolume",
announcementChannelId: "responses.settings.labelAnnouncementChannel",
restrictVolume: "responses.settings.labelRestrictVolume",
autojoin_channel: "responses.settings.labelAutojoinChannel"
};
if (localeMap[key] && t && guildId) return t(guildId, localeMap[key]);
const fallback = {
songAnnouncements: "Song announcements",
prefix: "Prefix",
pfx: "Bot avatar style",
@@ -397,7 +409,7 @@ function prettifySettingLabel(key) {
restrictVolume: "Restrict volume",
autojoin_channel: "Autojoin channel"
};
return custom[key] ?? key.replace(/_/g, " ");
return fallback[key] ?? key.replace(/_/g, " ");
}
async function handle247(ctx, message, value) {
@@ -483,8 +495,7 @@ async function handle247(ctx, message, value) {
const channels = get247Channels(set);
if (!channels.has(id) && channels.size >= MAX_247_CHANNELS) {
return message.reply(embed(
`You can save up to ${MAX_247_CHANNELS} 24/7 voice channels in one server. ` +
`Use \`${set.get("prefix") ?? "%"}247 off\` in one of the saved channels first.`
ctx.t(message, "responses.settings.max247Channels", { max: MAX_247_CHANNELS, prefix: set.get("prefix") ?? "%" })
));
}
channels.add(id);
@@ -806,7 +817,7 @@ export async function run(message, data) {
));
}
const description = this.settingsMgr.descriptions?.[settingKey] ?? "No description available.";
const description = this.settingsMgr.descriptions?.[settingKey] ?? this.t(message, "responses.settings.noDescription");
const currentVal = set.get(settingKey);
const defaultVal = this.settingsMgr.defaults?.[settingKey];