feat: button translations

This commit is contained in:
TrèsAbhi committed 2024-03-09 12:05:28 -06:00
1 parent 9d6d893373
commit 8d5e78a510
2 files changed
+8 -1

No files matched your search

+4 -1
View File
@@ -1,15 +1,18 @@
import { ChatInputCommandInteraction } from 'discord.js'; import { ChatInputCommandInteraction } from 'discord.js';
import { translator } from '../localization/translator';
import buttonPrimary from './buttonPrimary'; import buttonPrimary from './buttonPrimary';
export function buttonRefresh( export function buttonRefresh(
interaction: ChatInputCommandInteraction, interaction: ChatInputCommandInteraction,
path: string, path: string,
) { ) {
const { t } = translator(interaction.locale);
if ( if (
interaction.appPermissions?.has('ReadMessageHistory') && interaction.appPermissions?.has('ReadMessageHistory') &&
interaction.appPermissions?.has('ViewChannel') interaction.appPermissions?.has('ViewChannel')
) { ) {
return buttonPrimary(path, 'Refresh'); return buttonPrimary(path, t`bot.common.buttons.refresh`);
} }
return null; return null;
+4
View File
@@ -178,6 +178,10 @@
"tanks_found": "No tanks found" "tanks_found": "No tanks found"
}, },
"buttons": {
"refresh": "Refresh"
},
"errors": { "errors": {
"clan_not_found": "# Could not find clan\nCouldn't find \"%s\". Try selecting a clan from the search result.", "clan_not_found": "# Could not find clan\nCouldn't find \"%s\". Try selecting a clan from the search result.",
"player_not_found": "# Could not find user\nI couldn't find user \"%s\". Try picking an user from the search result, typing in a valid username, or using the `/link` command.", "player_not_found": "# Could not find user\nI couldn't find user \"%s\". Try picking an user from the search result, typing in a valid username, or using the `/link` command.",