From 8d5e78a510ad75dd006ef467ce360a5bbcc73422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sat, 9 Mar 2024 12:05:28 -0600 Subject: [PATCH] feat: button translations --- src/core/discord/buttonRefresh.ts | 5 ++++- src/lang/en-US.json | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/discord/buttonRefresh.ts b/src/core/discord/buttonRefresh.ts index 895c37fc5..5802a2df2 100644 --- a/src/core/discord/buttonRefresh.ts +++ b/src/core/discord/buttonRefresh.ts @@ -1,15 +1,18 @@ import { ChatInputCommandInteraction } from 'discord.js'; +import { translator } from '../localization/translator'; import buttonPrimary from './buttonPrimary'; export function buttonRefresh( interaction: ChatInputCommandInteraction, path: string, ) { + const { t } = translator(interaction.locale); + if ( interaction.appPermissions?.has('ReadMessageHistory') && interaction.appPermissions?.has('ViewChannel') ) { - return buttonPrimary(path, 'Refresh'); + return buttonPrimary(path, t`bot.common.buttons.refresh`); } return null; diff --git a/src/lang/en-US.json b/src/lang/en-US.json index 2197122d7..432de1744 100644 --- a/src/lang/en-US.json +++ b/src/lang/en-US.json @@ -178,6 +178,10 @@ "tanks_found": "No tanks found" }, + "buttons": { + "refresh": "Refresh" + }, + "errors": { "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.",