Localize upstream /help changes

This commit is contained in:
tacheometry committed 2023-12-17 07:35:00 +02:00
1 parent 114538b69d
commit a660a97103
3 files changed
+6 -30

No files matched your search

+2 -2
View File
@@ -56,9 +56,9 @@
"name": "help", "name": "help",
"description": "Show the list of bot commands." "description": "Show the list of bot commands."
}, },
"addBotCallout": "{{icon}} **Enjoying {{botName}}?**\nAdd me to another server:\n**[Click me!]({{invite}})**", "addBotButton": "Add bot",
"listTitle": "{{icon}} **List of commands**", "listTitle": "{{icon}} **List of commands**",
"supportServerCallout": "{{icon}} **Support server**\nJoin the support server for help or to suggest improvements:\n{{invite}}" "supportServerButton": "Support server"
}, },
"history": { "history": {
"metadata": { "metadata": {
+2 -2
View File
@@ -57,9 +57,9 @@ interface Resources {
"name": "help", "name": "help",
"description": "Show the list of bot commands." "description": "Show the list of bot commands."
}, },
"addBotCallout": "{{icon}} **Enjoying {{botName}}?**\nAdd me to another server:\n**[Click me!]({{invite}})**", "addBotButton": "Add bot",
"listTitle": "{{icon}} **List of commands**", "listTitle": "{{icon}} **List of commands**",
"supportServerCallout": "{{icon}} **Support server**\nJoin the support server for help or to suggest improvements:\n{{invite}}" "supportServerButton": "Support server"
}, },
"history": { "history": {
"metadata": { "metadata": {
+2 -26
View File
@@ -15,7 +15,6 @@ import { BaseSlashCommandInteraction } from '../../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../../common/localeUtil';
import { ExtendedClient } from '../../../types/clientTypes'; import { ExtendedClient } from '../../../types/clientTypes';
import { TFunction } from 'i18next';
class HelpCommand extends BaseSlashCommandInteraction { class HelpCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -37,7 +36,7 @@ class HelpCommand extends BaseSlashCommandInteraction {
.setURL(this.botOptions.serverInviteUrl) .setURL(this.botOptions.serverInviteUrl)
.setStyle(ButtonStyle.Link) .setStyle(ButtonStyle.Link)
.setEmoji(this.embedOptions.icons.support) .setEmoji(this.embedOptions.icons.support)
.setLabel('Support server') .setLabel(translator('commands.help.supportServerButton'))
.toJSON(); .toJSON();
components.push(supportServerButton); components.push(supportServerButton);
} }
@@ -47,7 +46,7 @@ class HelpCommand extends BaseSlashCommandInteraction {
.setURL(this.botOptions.botInviteUrl) .setURL(this.botOptions.botInviteUrl)
.setStyle(ButtonStyle.Link) .setStyle(ButtonStyle.Link)
.setEmoji(this.embedOptions.icons.bot) .setEmoji(this.embedOptions.icons.bot)
.setLabel('Add bot') .setLabel(translator('commands.help.addBotButton'))
.toJSON(); .toJSON();
components.push(addBotButton); components.push(addBotButton);
} }
@@ -110,29 +109,6 @@ class HelpCommand extends BaseSlashCommandInteraction {
} }
return ''; return '';
} }
private async getSupportServerString(translator: TFunction): Promise<string> {
if (!this.botOptions.serverInviteUrl) {
return '';
}
return translator('commands.help.supportServerCallout', {
icon: this.embedOptions.icons.support,
invite: this.botOptions.serverInviteUrl
});
}
private async getAddBotString(translator: TFunction): Promise<string> {
if (!this.botOptions.botInviteUrl) {
return '';
}
return translator('commands.help.addBotCallout', {
icon: this.embedOptions.icons.bot,
botName: this.botOptions.name,
invite: this.botOptions.botInviteUrl
});
}
} }
export default new HelpCommand(); export default new HelpCommand();