mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 06:28:53 +00:00
lang: translate messages for errors that were missing
This commit is contained in:
1 parent
16333201a9
commit
733b638cb0
6 files changed
+81
-26
No files matched your search
@@ -102,7 +102,7 @@ class HelpCommand extends BaseSlashCommandInteraction {
|
||||
private getCommandString(command: BaseSlashCommandInteraction, interaction: ChatInputCommandInteraction): string {
|
||||
const commandName = command.data.name;
|
||||
const metadataKey = `commands.${commandName}.metadata`;
|
||||
const locale = interaction.guildLocale ?? 'en';
|
||||
const locale = interaction.guildLocale ?? 'en-US';
|
||||
let translatedData: CommandMetadata | undefined = undefined;
|
||||
translatedData = translatorInstance.getResource(locale, 'bot', metadataKey) as CommandMetadata | undefined;
|
||||
|
||||
@@ -122,7 +122,7 @@ class HelpCommand extends BaseSlashCommandInteraction {
|
||||
|
||||
if (option instanceof SlashCommandNumberOption || option instanceof SlashCommandStringOption) {
|
||||
const metadataKey = `commands.${commandName}.metadata.options.${option.name}`;
|
||||
const locale = interaction.guildLocale ?? 'en';
|
||||
const locale = interaction.guildLocale ?? 'en-US';
|
||||
let translatedData: CommandMetadata | undefined = undefined;
|
||||
translatedData = translatorInstance.getResource(locale, 'bot', metadataKey) as CommandMetadata | undefined;
|
||||
return `**\`${translatedData?.name ?? option.name}\`** `;
|
||||
|
||||
Reference in new issue
Block a user