diff --git a/.vscode/settings.json b/.vscode/settings.json index 57b505836..40ca50cf8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,7 @@ "accountinfo", "aeson", "alphatest", + "APAC", "apcr", "artefacts", "atgm", diff --git a/src/commands/ownedTanks.tsx b/src/commands/ownedTanks.tsx index 3b5f41033..88037733d 100644 --- a/src/commands/ownedTanks.tsx +++ b/src/commands/ownedTanks.tsx @@ -2,7 +2,6 @@ import CommandWrapper from '../components/CommandWrapper'; import NoData from '../components/NoData'; import * as Tanks from '../components/Tanks'; import TitleBar from '../components/TitleBar'; -import { encyclopediaInfo } from '../core/blitz/encyclopediaInfo'; import { getAccountInfo } from '../core/blitz/getAccountInfo'; import { getClanAccountInfo } from '../core/blitz/getClanAccountInfo'; import getTankStats from '../core/blitz/getTankStats'; @@ -88,9 +87,9 @@ export const ownedTanksCommand = new Promise((resolve) => { const rightColumn = tanks.slice(leftColumnSize); return ( - + - {(await encyclopediaInfo).vehicle_nations[nation]} + {translate(`common.nations.${nation}`)} diff --git a/src/events/interactionCreate/handlers/chatInputCommand.ts b/src/events/interactionCreate/handlers/chatInputCommand.ts index 93e93ea4c..e056cbbc2 100644 --- a/src/events/interactionCreate/handlers/chatInputCommand.ts +++ b/src/events/interactionCreate/handlers/chatInputCommand.ts @@ -13,6 +13,7 @@ import buttonLink from '../../../core/discord/buttonLink'; import embedWarning from '../../../core/discord/embedWarning'; import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable'; import { psa } from '../../../core/discord/psa'; +import { translator } from '../../../core/localization/translator'; import { UserError } from '../../../hooks/userError'; export default async function handleChatInputCommand( @@ -107,10 +108,11 @@ export default async function handleChatInputCommand( interaction.followUp(followUp); } } catch (error) { + const { t } = translator(interaction.locale); const components = [ new ActionRowBuilder().addComponents( new ButtonBuilder() - .setLabel('Get Help on Discord Server') + .setLabel(t`bot.common.errors.get_help`) .setURL('https://discord.gg/nDt7AjGJQH') .setStyle(ButtonStyle.Link), ), @@ -125,8 +127,7 @@ export default async function handleChatInputCommand( console.error(interaction.commandName, error); interaction.editReply({ - content: - "# Blitzkrieg ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help.", + content: t`bot.common.errors.uncaught_error`, components, }); } diff --git a/src/lang/en-US.json b/src/lang/en-US.json index 9aeab2dbc..2197122d7 100644 --- a/src/lang/en-US.json +++ b/src/lang/en-US.json @@ -184,7 +184,9 @@ "player_not_linked": "# I don't know who you are\nUse the `/link` command to get started.", "tank_name_not_found": "# Tank not found\nCould not find tank by the name \"%s\".", "tank_id_not_found": "# Tank not found\nCould not find tank by the ID \"%s\". Try typing the name of the tank instead of a number.", - "no_tank_stats": "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for." + "no_tank_stats": "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for.", + "get_help": "Help Discord server", + "uncaught_error": "# Blitzkrieg ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help." } },