mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: button translations
This commit is contained in:
1 parent
9d6d893373
commit
8d5e78a510
2 files changed
+8
-1
No files matched your search
@@ -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;
|
||||||
|
|||||||
@@ -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.",
|
||||||
|
|||||||
Reference in new issue
Block a user