(async (resolve) => {
const nations = await NATIONS;
- const command = addFilterOptions(
- new SlashCommandBuilder()
- .setName('today')
- .setDescription("Today's played tanks and statistics"),
- nations,
- ).addStringOption(addUsernameChoices);
-
resolve({
inProduction: true,
inPublic: true,
- command,
+ command: addFilterOptions(
+ createLocalizedCommand('today'),
+ nations,
+ ).addStringOption(addUsernameChoices),
async handler(interaction) {
const player = await resolvePlayerFromCommand(interaction);
diff --git a/src/components/AllStatsOverview/components/WN8Display/index.tsx b/src/components/AllStatsOverview/components/WN8Display/index.tsx
index 3e33af43b..8be77a70f 100644
--- a/src/components/AllStatsOverview/components/WN8Display/index.tsx
+++ b/src/components/AllStatsOverview/components/WN8Display/index.tsx
@@ -1,30 +1,21 @@
+import { Locale } from 'discord.js';
import { Percentile } from '../../../../constants/percentiles';
+import { translator } from '../../../../core/localization/translator';
import getWN8Percentile from '../../../../core/statistics/getWN8Percentile';
import { theme } from '../../../../stitches.config';
import { PERCENTILE_COLORS } from '../../../PercentileIndicator';
import { Glow } from './components/Glow';
export interface WN8DisplayProps {
- WN8?: number;
+ wn8?: number;
+ locale: Locale;
}
-export const PERCENTILE_NAMES = {
- [Percentile.VeryBad]: 'Very Bad',
- [Percentile.Bad]: 'Bad',
- [Percentile.BelowAverage]: 'Below Average',
- [Percentile.Average]: 'Average',
- [Percentile.AboveAverage]: 'Above Average',
- [Percentile.Good]: 'Good',
- [Percentile.VeryGood]: 'Very Good',
- [Percentile.Great]: 'Great',
- [Percentile.Unicum]: 'Unicum',
- [Percentile.SuperUnicum]: 'Super Unicum',
-};
-
-export function WN8Display({ WN8 }: WN8DisplayProps) {
+export function WN8Display({ wn8, locale }: WN8DisplayProps) {
const percentile =
- WN8 === undefined ? Percentile.VeryBad : getWN8Percentile(WN8);
+ wn8 === undefined ? Percentile.VeryBad : getWN8Percentile(wn8);
const color = PERCENTILE_COLORS[percentile];
+ const { translate } = translator(locale);
return (
- {WN8 === undefined ? '--' : WN8.toFixed(0)}
+ {wn8 === undefined ? '--' : wn8.toFixed(0)}
- {PERCENTILE_NAMES[percentile]}
+ {translate(`common.wn8_percentile.${percentile}`)}
diff --git a/src/components/AllStatsOverview/index.tsx b/src/components/AllStatsOverview/index.tsx
index 5b3f4d0f3..6868b03c0 100644
--- a/src/components/AllStatsOverview/index.tsx
+++ b/src/components/AllStatsOverview/index.tsx
@@ -1,4 +1,6 @@
+import { Locale } from 'discord.js';
import { AllStats, SupplementaryStats } from '../../core/blitz/getAccountInfo';
+import { translator } from '../../core/localization/translator';
import { WN8Display } from './components/WN8Display';
import {
WN8SurroundingStat,
@@ -8,12 +10,16 @@ import {
export interface AllStatsOverviewProps {
stats: AllStats;
supplementaryStats: SupplementaryStats;
+ locale: Locale;
}
export default function AllStatsOverview({
stats,
+ locale,
supplementaryStats,
}: AllStatsOverviewProps) {
+ const { t } = translator(locale);
+
return (
-
+
({
- name: `Tier ${tier} - ${numberToRomanNumeral(tier)}`,
- value: `${tier}`,
- })),
+ ...range(10, 0).map(
+ (tier) =>
+ ({
+ name: translate('bot.common.options.tier.choices.tier', [
+ `${tier}`,
+ numberToRomanNumeral(tier),
+ ]),
+ value: `${tier}`,
+ name_localizations: localizationObject(
+ 'bot.common.options.tier.choices.tier',
+ [`${tier}`, numberToRomanNumeral(tier)],
+ ),
+ }) satisfies APIApplicationCommandOptionChoice,
+ ),
)
.setRequired(true);
}
diff --git a/src/lang/en-US.json b/src/lang/en-US.json
index 40e4e7aa9..e33d38a45 100644
--- a/src/lang/en-US.json
+++ b/src/lang/en-US.json
@@ -1,5 +1,18 @@
{
"common": {
+ "wn8_percentile": {
+ "0": "Very bad",
+ "1": "Bad",
+ "2": "Below average",
+ "3": "Average",
+ "4": "Above average",
+ "5": "Good",
+ "6": "Very good",
+ "7": "Great",
+ "8": "Unicum",
+ "9": "Super unicum"
+ },
+
"nations": {
"ussr": "U.S.S.R.",
"germany": "Germany",
@@ -135,6 +148,15 @@
"region": {
"$": "region",
"description": "Region"
+ },
+
+ "tier": {
+ "$": "tier",
+ "description": "Tier",
+
+ "choices": {
+ "tier": "Tier %s - %s"
+ }
}
},
@@ -386,6 +408,69 @@
"neighbors": "Ratings neighbors",
"more": "+%s more"
}
+ },
+
+ "today": {
+ "$": "today",
+ "description": "Today's played tanks and statistics"
+ },
+
+ "stats": {
+ "$": "stats",
+ "description": "Quick statistics for a period",
+
+ "body": {
+ "battles": "Battles",
+ "winrate": "Winrate",
+ "damage": "Damage",
+ "damage_ratio": "Damage ratio",
+ "tier": "Tier",
+ "survival": "Survival",
+ "accuracy": "Accuracy",
+ "kill_ratio": "Kill ratio"
+ }
+ },
+
+ "owned_tanks": {
+ "$": "owned-tanks",
+ "description": "Shows all own tanks in a tier",
+
+ "body": {
+ "subtitle": "Tier %s tanks"
+ }
+ },
+
+ "permissions": {
+ "$": "permissions",
+ "description": "Checks wether the bot has the required permissions to function",
+
+ "body": {
+ "title": "# Permissions\n\n%s",
+ "view_channels": "View channels: needed for the refresh button to work",
+ "read_message_history": "Read message history: needed for the refresh button to find the message to refresh",
+ "attach_files": "Attach files: needed for image-based commands to work"
+ }
+ },
+
+ "ping": {
+ "$": "ping",
+ "description": "Check wether the bot is alive.",
+
+ "body": {
+ "pong": "Pong 🏓",
+ "pong_with_time": "Pong 🏓 - %sms"
+ },
+
+ "subcommands": {
+ "blitzkrieg": {
+ "$": "blitzkrieg",
+ "description": "Ping Blitzkrieg"
+ },
+ "wotb": {
+ "$": "wotb",
+ "description": "Ping World of Tanks Blitz"
+ }
+ }
}
}
},
From 7f9b349de68ccd2d8afc053e28d01ded0315277e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com>
Date: Fri, 8 Mar 2024 20:29:58 -0600
Subject: [PATCH 67/90] New translations en-us.json (Spanish)
---
src/lang/es-ES.json | 72 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/src/lang/es-ES.json b/src/lang/es-ES.json
index 4df6543d8..53debb9ea 100644
--- a/src/lang/es-ES.json
+++ b/src/lang/es-ES.json
@@ -1,5 +1,17 @@
{
"common": {
+ "wn8_percentile": {
+ "0": "Very bad",
+ "1": "Bad",
+ "2": "Below average",
+ "3": "Average",
+ "4": "Above average",
+ "5": "Good",
+ "6": "Very good",
+ "7": "Great",
+ "8": "Unicum",
+ "9": "Super unicum"
+ },
"nations": {
"ussr": "URSS",
"germany": "Alemania",
@@ -123,6 +135,13 @@
"region": {
"$": "región",
"description": "Región"
+ },
+ "tier": {
+ "$": "tier",
+ "description": "Tier",
+ "choices": {
+ "tier": "Tier %s - %s"
+ }
}
},
"periods": {
@@ -341,6 +360,59 @@
"neighbors": "Vecinos de Clasificación",
"more": "+%s más"
}
+ },
+ "today": {
+ "$": "today",
+ "description": "Today's played tanks and statistics"
+ },
+ "stats": {
+ "$": "stats",
+ "description": "Quick statistics for a period",
+ "body": {
+ "battles": "Battles",
+ "winrate": "Winrate",
+ "damage": "Damage",
+ "damage_ratio": "Damage ratio",
+ "tier": "Tier",
+ "survival": "Survival",
+ "accuracy": "Accuracy",
+ "kill_ratio": "Kill ratio"
+ }
+ },
+ "owned_tanks": {
+ "$": "owned-tanks",
+ "description": "Shows all own tanks in a tier",
+ "body": {
+ "subtitle": "Tier %s tanks"
+ }
+ },
+ "permissions": {
+ "$": "permissions",
+ "description": "Checks wether the bot has the required permissions to function",
+ "body": {
+ "title": "# Permissions\n\n%s",
+ "view_channels": "View channels: needed for the refresh button to work",
+ "read_message_history": "Read message history: needed for the refresh button to find the message to refresh",
+ "attach_files": "Attach files: needed for image-based commands to work"
+ }
+ },
+ "ping": {
+ "$": "ping",
+ "description": "Check wether the bot is alive.",
+ "body": {
+ "pong": "Pong 🏓",
+ "pong_with_time": "Pong 🏓 - %sms"
+ },
+ "subcommands": {
+ "blitzkrieg": {
+ "$": "blitzkrieg",
+ "description": "Ping Blitzkrieg"
+ },
+ "wotb": {
+ "$": "wotb",
+ "description": "Ping World of Tanks Blitz"
+ }
+ }
}
}
},
From 153d0d326d22466345d693ccd2db7569015217cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com>
Date: Fri, 8 Mar 2024 20:29:58 -0600
Subject: [PATCH 68/90] New translations en-us.json (Croatian (disambiguation))
---
src/lang/hr.json | 72 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/src/lang/hr.json b/src/lang/hr.json
index 483211636..8275a9782 100644
--- a/src/lang/hr.json
+++ b/src/lang/hr.json
@@ -1,5 +1,17 @@
{
"common": {
+ "wn8_percentile": {
+ "0": "Very bad",
+ "1": "Bad",
+ "2": "Below average",
+ "3": "Average",
+ "4": "Above average",
+ "5": "Good",
+ "6": "Very good",
+ "7": "Great",
+ "8": "Unicum",
+ "9": "Super unicum"
+ },
"nations": {
"ussr": "U.S.S.R.",
"germany": "Germany",
@@ -123,6 +135,13 @@
"region": {
"$": "region",
"description": "Region"
+ },
+ "tier": {
+ "$": "tier",
+ "description": "Tier",
+ "choices": {
+ "tier": "Tier %s - %s"
+ }
}
},
"periods": {
@@ -341,6 +360,59 @@
"neighbors": "Ratings neighbors",
"more": "+%s more"
}
+ },
+ "today": {
+ "$": "today",
+ "description": "Today's played tanks and statistics"
+ },
+ "stats": {
+ "$": "stats",
+ "description": "Quick statistics for a period",
+ "body": {
+ "battles": "Battles",
+ "winrate": "Winrate",
+ "damage": "Damage",
+ "damage_ratio": "Damage ratio",
+ "tier": "Tier",
+ "survival": "Survival",
+ "accuracy": "Accuracy",
+ "kill_ratio": "Kill ratio"
+ }
+ },
+ "owned_tanks": {
+ "$": "owned-tanks",
+ "description": "Shows all own tanks in a tier",
+ "body": {
+ "subtitle": "Tier %s tanks"
+ }
+ },
+ "permissions": {
+ "$": "permissions",
+ "description": "Checks wether the bot has the required permissions to function",
+ "body": {
+ "title": "# Permissions\n\n%s",
+ "view_channels": "View channels: needed for the refresh button to work",
+ "read_message_history": "Read message history: needed for the refresh button to find the message to refresh",
+ "attach_files": "Attach files: needed for image-based commands to work"
+ }
+ },
+ "ping": {
+ "$": "ping",
+ "description": "Check wether the bot is alive.",
+ "body": {
+ "pong": "Pong 🏓",
+ "pong_with_time": "Pong 🏓 - %sms"
+ },
+ "subcommands": {
+ "blitzkrieg": {
+ "$": "blitzkrieg",
+ "description": "Ping Blitzkrieg"
+ },
+ "wotb": {
+ "$": "wotb",
+ "description": "Ping World of Tanks Blitz"
+ }
+ }
}
}
},
From 3181f9c4e7fc4c888aaf98e3b70b47820f241f79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com>
Date: Fri, 8 Mar 2024 20:32:06 -0600
Subject: [PATCH 69/90] feat: removed player acheivements
---
src/commands/playerAchievements.ts | 139 +++++++++++++++--------------
1 file changed, 73 insertions(+), 66 deletions(-)
diff --git a/src/commands/playerAchievements.ts b/src/commands/playerAchievements.ts
index ec76f0a0f..1f029216f 100644
--- a/src/commands/playerAchievements.ts
+++ b/src/commands/playerAchievements.ts
@@ -1,73 +1,80 @@
-import { SlashCommandBuilder } from 'discord.js';
-import { startCase } from 'lodash';
-import markdownEscape from 'markdown-escape';
-import { getAccountAchievements } from '../core/blitz/getAccountAchievements';
-import { getAccountInfo } from '../core/blitz/getAccountInfo';
-import addUsernameChoices from '../core/discord/addUsernameChoices';
-import autocompleteUsername from '../core/discord/autocompleteUsername';
-import embedInfo from '../core/discord/embedInfo';
-import markdownTable, { TableInputEntry } from '../core/discord/markdownTable';
-import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
-import { CommandRegistry } from '../events/interactionCreate';
+// _____ _____ _ _ _ _ _____ ____ __ __ ______ ____ _____ _ __
+// |_ _| / ____| | | | /\ | | | | / ____/ __ \| \/ | ____| | _ \ /\ / ____| |/ /
+// | | | (___ | |__| | / \ | | | | | | | | | | \ / | |__ | |_) | / \ | | | ' /
+// | | \___ \| __ | / /\ \ | | | | | | | | | | |\/| | __| | _ < / /\ \| | | <
+// _| |_ ____) | | | |/ ____ \| |____| |____ | |___| |__| | | | | |____ | |_) / ____ \ |____| . \
+// |_____| |_____/|_| |_/_/ \_\______|______| \_____\____/|_| |_|______| |____/_/ \_\_____|_|\_\
-type SortBy = 'name' | 'count';
+// import { SlashCommandBuilder } from 'discord.js';
+// import { startCase } from 'lodash';
+// import markdownEscape from 'markdown-escape';
+// import { getAccountAchievements } from '../core/blitz/getAccountAchievements';
+// import { getAccountInfo } from '../core/blitz/getAccountInfo';
+// import addUsernameChoices from '../core/discord/addUsernameChoices';
+// import autocompleteUsername from '../core/discord/autocompleteUsername';
+// import embedInfo from '../core/discord/embedInfo';
+// import markdownTable, { TableInputEntry } from '../core/discord/markdownTable';
+// import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
+// import { CommandRegistry } from '../events/interactionCreate';
-export const playerAchievementsCommand = new Promise(
- (resolve) => {
- resolve({
- inProduction: true,
- inPublic: true,
+// type SortBy = 'name' | 'count';
- command: new SlashCommandBuilder()
- .setName('player-achievements')
- .setDescription("All the player's achievements")
- .addStringOption(addUsernameChoices)
- .addStringOption((option) =>
- option
- .setName('sort')
- .setDescription('What to sort by (default: name)')
- .addChoices(
- { name: 'By name', value: 'name' satisfies SortBy },
- { name: 'By count', value: 'count' satisfies SortBy },
- ),
- ),
+// export const playerAchievementsCommand = new Promise(
+// (resolve) => {
+// resolve({
+// inProduction: true,
+// inPublic: true,
- async handler(interaction) {
- const sortBy = (interaction.options.getString('sort') ??
- 'name') as SortBy;
- const account = await resolvePlayerFromCommand(interaction);
- const { id, region: region } = account;
- const accountInfo = await getAccountInfo(region, id);
- const accountsAchievements = await getAccountAchievements(region, id);
- const accountAchievements = accountsAchievements;
- const compound = {
- ...accountAchievements.achievements,
- ...accountAchievements.max_series,
- };
+// command: new SlashCommandBuilder()
+// .setName('player-achievements')
+// .setDescription("All the player's achievements")
+// .addStringOption(addUsernameChoices)
+// .addStringOption((option) =>
+// option
+// .setName('sort')
+// .setDescription('What to sort by (default: name)')
+// .addChoices(
+// { name: 'By name', value: 'name' satisfies SortBy },
+// { name: 'By count', value: 'count' satisfies SortBy },
+// ),
+// ),
- return embedInfo(
- `${markdownEscape(accountInfo.nickname)}'s information`,
+// async handler(interaction) {
+// const sortBy = (interaction.options.getString('sort') ??
+// 'name') as SortBy;
+// const account = await resolvePlayerFromCommand(interaction);
+// const { id, region: region } = account;
+// const accountInfo = await getAccountInfo(region, id);
+// const accountsAchievements = await getAccountAchievements(region, id);
+// const accountAchievements = accountsAchievements;
+// const compound = {
+// ...accountAchievements.achievements,
+// ...accountAchievements.max_series,
+// };
- markdownTable(
- Object.keys(compound)
- .filter((achievement) => compound[achievement] > 0)
- .sort(
- sortBy === 'count'
- ? (a, b) => compound[b] - compound[a]
- : undefined,
- )
- .map(
- (achievement) =>
- [
- startCase(achievement),
- compound[achievement],
- ] as TableInputEntry,
- ),
- ),
- );
- },
+// return embedInfo(
+// `${markdownEscape(accountInfo.nickname)}'s information`,
- autocomplete: autocompleteUsername,
- });
- },
-);
+// markdownTable(
+// Object.keys(compound)
+// .filter((achievement) => compound[achievement] > 0)
+// .sort(
+// sortBy === 'count'
+// ? (a, b) => compound[b] - compound[a]
+// : undefined,
+// )
+// .map(
+// (achievement) =>
+// [
+// startCase(achievement),
+// compound[achievement],
+// ] as TableInputEntry,
+// ),
+// ),
+// );
+// },
+
+// autocomplete: autocompleteUsername,
+// });
+// },
+// );
From b2220f885e97634287bcf379b67e804b4e6d8ce0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com>
Date: Fri, 8 Mar 2024 20:43:30 -0600
Subject: [PATCH 70/90] New translations en-us.json (Spanish)
---
src/lang/es-ES.json | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/lang/es-ES.json b/src/lang/es-ES.json
index 53debb9ea..2c606faf1 100644
--- a/src/lang/es-ES.json
+++ b/src/lang/es-ES.json
@@ -413,6 +413,19 @@
"description": "Ping World of Tanks Blitz"
}
}
+ },
+ "player_info": {
+ "$": "player-info",
+ "description": "Basic information about a player",
+ "body": {
+ "title": "%'s information",
+ "nickname": "Nickname",
+ "battles": "Battles",
+ "winrate": "Winrate",
+ "account_id": "Account ID",
+ "created": "Created",
+ "last_battle": "Last battle"
+ }
}
}
},
From 4fedaf1cea8ddd7b90eee216667b035e64579837 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com>
Date: Fri, 8 Mar 2024 20:43:30 -0600
Subject: [PATCH 71/90] feat: removed search tanks
---
.../components/Model/components/TankModel.tsx | 10 +--
src/commands/playerInfo.ts | 40 ++++++---
src/commands/ratings.tsx | 4 +-
src/commands/searchTanks.ts | 87 ++++++++++---------
src/core/blitz/applyPitchYawLimits.ts | 8 +-
...malizeAngle180.ts => normalizeAngleRad.ts} | 2 +-
src/events/interactionCreate/index.ts | 4 -
src/lang/en-US.json | 15 ++++
8 files changed, 101 insertions(+), 69 deletions(-)
rename src/core/math/{normalizeAngle180.ts => normalizeAngleRad.ts} (77%)
diff --git a/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx b/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx
index 472675451..e5253be2e 100644
--- a/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx
+++ b/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx
@@ -10,7 +10,7 @@ import {
ModelTransformEventData,
modelTransformEvent,
} from '../../../../../../../core/blitzkrieg/modelTransform';
-import { normalizeAnglePI } from '../../../../../../../core/math/normalizeAngle180';
+import { normalizeAngleRad } from '../../../../../../../core/math/normalizeAngleRad';
import { useAwait } from '../../../../../../../hooks/useAwait';
import { useModel } from '../../../../../../../hooks/useModel';
import { mutateDuel, useDuel } from '../../../../../../../stores/duel';
@@ -172,8 +172,8 @@ export const TankModel = memo(() => {
}
function handlePointerUp() {
mutateDuel((draft) => {
- draft.protagonist!.pitch = normalizeAnglePI(pitch);
- draft.protagonist!.yaw = normalizeAnglePI(yaw);
+ draft.protagonist!.pitch = normalizeAngleRad(pitch);
+ draft.protagonist!.yaw = normalizeAngleRad(yaw);
});
mutateTankopediaPersistent((draft) => {
draft.model.visual.controlsEnabled = true;
@@ -234,8 +234,8 @@ export const TankModel = memo(() => {
draft.model.visual.controlsEnabled = true;
});
mutateDuel((draft) => {
- draft.protagonist!.pitch = normalizeAnglePI(pitch);
- draft.protagonist!.yaw = normalizeAnglePI(yaw);
+ draft.protagonist!.pitch = normalizeAngleRad(pitch);
+ draft.protagonist!.yaw = normalizeAngleRad(yaw);
});
window.removeEventListener('pointermove', handlePointerMove);
window.removeEventListener('pointerup', handlePointerUp);
diff --git a/src/commands/playerInfo.ts b/src/commands/playerInfo.ts
index 69a628be9..f9db1c97f 100644
--- a/src/commands/playerInfo.ts
+++ b/src/commands/playerInfo.ts
@@ -1,11 +1,12 @@
-import { SlashCommandBuilder } from 'discord.js';
import markdownEscape from 'markdown-escape';
import { getAccountInfo } from '../core/blitz/getAccountInfo';
import addUsernameChoices from '../core/discord/addUsernameChoices';
import autocompleteUsername from '../core/discord/autocompleteUsername';
+import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
import embedInfo from '../core/discord/embedInfo';
import markdownTable from '../core/discord/markdownTable';
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
+import { translator } from '../core/localization/translator';
import { CommandRegistry } from '../events/interactionCreate';
export const playerInfoCommand = new Promise((resolve) => {
@@ -13,24 +14,28 @@ export const playerInfoCommand = new Promise((resolve) => {
inProduction: true,
inPublic: true,
- command: new SlashCommandBuilder()
- .setName('player-info')
- .setDescription('Basic information about a player')
- .addStringOption(addUsernameChoices),
+ command:
+ createLocalizedCommand('player-info').addStringOption(addUsernameChoices),
async handler(interaction) {
+ const { t, translate } = translator(interaction.locale);
const account = await resolvePlayerFromCommand(interaction);
const { id, region: region } = account;
const accountInfo = await getAccountInfo(region, id);
return embedInfo(
- `${markdownEscape(accountInfo.nickname)}'s information`,
+ translate('bot.command.player_info.body.title', [
+ markdownEscape(accountInfo.nickname),
+ ]),
markdownTable([
- ['Nickname', `${accountInfo.nickname}`],
- ['Battles', `${accountInfo.statistics.all.battles}`],
+ [t`bot.command.player_info.body.nickname`, `${accountInfo.nickname}`],
[
- 'Winrate',
+ t`bot.command.player_info.body.battles`,
+ `${accountInfo.statistics.all.battles}`,
+ ],
+ [
+ t`bot.command.player_info.body.winrate`,
`${(
100 *
(accountInfo.statistics.all.wins /
@@ -38,14 +43,21 @@ export const playerInfoCommand = new Promise((resolve) => {
).toFixed(2)}%`,
],
[],
- ['Account ID', `${accountInfo.account_id}`],
[
- 'Created',
- `${new Date(accountInfo.created_at * 1000).toDateString()}`,
+ t`bot.command.player_info.body.account_id`,
+ `${accountInfo.account_id}`,
],
[
- 'Last battle',
- `${new Date(accountInfo.last_battle_time * 1000).toDateString()}`,
+ t`bot.command.player_info.body.created`,
+ new Date(accountInfo.created_at * 1000).toLocaleDateString(
+ interaction.locale,
+ ),
+ ],
+ [
+ t`bot.command.player_info.body.last_battle`,
+ new Date(accountInfo.last_battle_time * 1000).toLocaleDateString(
+ interaction.locale,
+ ),
],
]),
);
diff --git a/src/commands/ratings.tsx b/src/commands/ratings.tsx
index 6496eb572..485d4e43e 100644
--- a/src/commands/ratings.tsx
+++ b/src/commands/ratings.tsx
@@ -351,7 +351,9 @@ export const ratingsCommand = new Promise(async (resolve) => {
playersAfter =
regionRatingsInfo.count - result[result.length - 1].position;
titleName = `${
- leagueInfo ? leagueInfo.title : ''
+ leagueInfo
+ ? translate(`common.leagues.${LEAGUES[leagueInfo.index].name}`)
+ : ''
} - ${translate(`common.regions.short.${region}`)}`;
titleImage = leagueInfo.big_icon.startsWith('http')
? leagueInfo.big_icon
diff --git a/src/commands/searchTanks.ts b/src/commands/searchTanks.ts
index 86dfa42ab..aae81e883 100644
--- a/src/commands/searchTanks.ts
+++ b/src/commands/searchTanks.ts
@@ -1,44 +1,51 @@
-import { SlashCommandBuilder } from 'discord.js';
-import { go } from 'fuzzysort';
-import markdownEscape from 'markdown-escape';
-import { tankNames } from '../core/blitzkrieg/tankDefinitions';
-import addTankChoices from '../core/discord/addTankChoices';
-import embedInfo from '../core/discord/embedInfo';
-import { CommandRegistry } from '../events/interactionCreate';
+// _____ _____ _ _ _ _ _____ ____ __ __ ______ ____ _____ _ __
+// |_ _| / ____| | | | /\ | | | | / ____/ __ \| \/ | ____| | _ \ /\ / ____| |/ /
+// | | | (___ | |__| | / \ | | | | | | | | | | \ / | |__ | |_) | / \ | | | ' /
+// | | \___ \| __ | / /\ \ | | | | | | | | | | |\/| | __| | _ < / /\ \| | | <
+// _| |_ ____) | | | |/ ____ \| |____| |____ | |___| |__| | | | | |____ | |_) / ____ \ |____| . \
+// |_____| |_____/|_| |_/_/ \_\______|______| \_____\____/|_| |_|______| |____/_/ \_\_____|_|\_\
-export const searchTanksCommand = new Promise((resolve) => {
- resolve({
- inProduction: true,
- inPublic: true,
+// import { SlashCommandBuilder } from 'discord.js';
+// import { go } from 'fuzzysort';
+// import markdownEscape from 'markdown-escape';
+// import { tankNames } from '../core/blitzkrieg/tankDefinitions';
+// import addTankChoices from '../core/discord/addTankChoices';
+// import embedInfo from '../core/discord/embedInfo';
+// import { CommandRegistry } from '../events/interactionCreate';
- command: new SlashCommandBuilder()
- .setName('search-tanks')
- .setDescription('Search tanks')
- .addStringOption((option) =>
- addTankChoices(option).setAutocomplete(false),
- )
- .addIntegerOption((option) =>
- option
- .setName('limit')
- .setDescription('The size of the search result (default: 25)')
- .setMinValue(1)
- .setMaxValue(100),
- ),
+// export const searchTanksCommand = new Promise((resolve) => {
+// resolve({
+// inProduction: true,
+// inPublic: true,
- async handler(interaction) {
- const tank = interaction.options.getString('tank')!;
- const limit = interaction.options.getInteger('limit') ?? 25;
- const results = go(tank, await tankNames, {
- limit,
- keys: ['combined'],
- }).map((result) => result.obj.original);
+// command: new SlashCommandBuilder()
+// .setName('search-tanks')
+// .setDescription('Search tanks')
+// .addStringOption((option) =>
+// addTankChoices(option).setAutocomplete(false),
+// )
+// .addIntegerOption((option) =>
+// option
+// .setName('limit')
+// .setDescription('The size of the search result (default: 25)')
+// .setMinValue(1)
+// .setMaxValue(100),
+// ),
- return embedInfo(
- `Tank search for "${markdownEscape(tank)}"`,
- results.length === 0
- ? 'No tanks found.'
- : `\`\`\`\n${results.join('\n')}\n\`\`\``,
- );
- },
- });
-});
+// async handler(interaction) {
+// const tank = interaction.options.getString('tank')!;
+// const limit = interaction.options.getInteger('limit') ?? 25;
+// const results = go(tank, await tankNames, {
+// limit,
+// keys: ['combined'],
+// }).map((result) => result.obj.original);
+
+// return embedInfo(
+// `Tank search for "${markdownEscape(tank)}"`,
+// results.length === 0
+// ? 'No tanks found.'
+// : `\`\`\`\n${results.join('\n')}\n\`\`\``,
+// );
+// },
+// });
+// });
diff --git a/src/core/blitz/applyPitchYawLimits.ts b/src/core/blitz/applyPitchYawLimits.ts
index 06994d837..7565ac3bf 100644
--- a/src/core/blitz/applyPitchYawLimits.ts
+++ b/src/core/blitz/applyPitchYawLimits.ts
@@ -1,6 +1,6 @@
import { clamp } from 'lodash';
import { PitchLimits, YawLimits } from '../blitzkrieg/modelDefinitions';
-import { normalizeAnglePI } from '../math/normalizeAngle180';
+import { normalizeAngleRad } from '../math/normalizeAngleRad';
export function applyPitchYawLimits(
pitch: number, // rad
@@ -12,7 +12,7 @@ export function applyPitchYawLimits(
let newYaw = yaw;
if (yawLimits) {
- newYaw = normalizeAnglePI(
+ newYaw = normalizeAngleRad(
clamp(
newYaw,
-yawLimits.max * (Math.PI / 180),
@@ -27,7 +27,7 @@ export function applyPitchYawLimits(
if (pitchLimits.back) {
const range = pitchLimits.back.range * (Math.PI / 180);
- const yawRotatedAbs = Math.abs(normalizeAnglePI(newYaw - Math.PI));
+ const yawRotatedAbs = Math.abs(normalizeAngleRad(newYaw - Math.PI));
if (yawRotatedAbs <= range + transition) {
if (yawRotatedAbs <= range) {
@@ -52,7 +52,7 @@ export function applyPitchYawLimits(
if (pitchLimits.front) {
const range = pitchLimits.front.range * (Math.PI / 180);
- const yawAbs = Math.abs(normalizeAnglePI(newYaw));
+ const yawAbs = Math.abs(normalizeAngleRad(newYaw));
if (yawAbs <= range + transition) {
if (yawAbs <= range) {
diff --git a/src/core/math/normalizeAngle180.ts b/src/core/math/normalizeAngleRad.ts
similarity index 77%
rename from src/core/math/normalizeAngle180.ts
rename to src/core/math/normalizeAngleRad.ts
index 264995e05..b62b23a10 100644
--- a/src/core/math/normalizeAngle180.ts
+++ b/src/core/math/normalizeAngleRad.ts
@@ -1,4 +1,4 @@
-export function normalizeAnglePI(angle: number) {
+export function normalizeAngleRad(angle: number) {
const newAngle = angle % (2 * Math.PI);
if (newAngle > Math.PI) return newAngle - 2 * Math.PI;
if (newAngle < -Math.PI) return newAngle + 2 * Math.PI;
diff --git a/src/events/interactionCreate/index.ts b/src/events/interactionCreate/index.ts
index 3f21ef942..3b3e8293e 100644
--- a/src/events/interactionCreate/index.ts
+++ b/src/events/interactionCreate/index.ts
@@ -24,12 +24,10 @@ import { verifyCommand } from '../../commands/link';
import { ownedTanksCommand } from '../../commands/ownedTanks';
import { permissionsCommand } from '../../commands/permissions';
import { pingCommand } from '../../commands/ping';
-import { playerAchievementsCommand } from '../../commands/playerAchievements';
import { playerInfoCommand } from '../../commands/playerInfo';
import { ratingsCommand } from '../../commands/ratings';
import { searchClansCommand } from '../../commands/searchClans';
import { searchPlayersCommand } from '../../commands/searchPlayers';
-import { searchTanksCommand } from '../../commands/searchTanks';
import { statsCommand } from '../../commands/stats';
import { todayCommand } from '../../commands/today';
import getClientId from '../../core/blitzkrieg/getClientId';
@@ -84,11 +82,9 @@ export const COMMANDS_RAW: Promise[] = [
aboutCommand,
inactiveCommand,
ownedTanksCommand,
- playerAchievementsCommand,
playerInfoCommand,
searchClansCommand,
searchPlayersCommand,
- searchTanksCommand,
fullStatsCommand,
breakdownCommand,
verifyCommand,
diff --git a/src/lang/en-US.json b/src/lang/en-US.json
index e33d38a45..c438702a2 100644
--- a/src/lang/en-US.json
+++ b/src/lang/en-US.json
@@ -471,6 +471,21 @@
"description": "Ping World of Tanks Blitz"
}
}
+ },
+
+ "player_info": {
+ "$": "player-info",
+ "description": "Basic information about a player",
+
+ "body": {
+ "title": "%'s information",
+ "nickname": "Nickname",
+ "battles": "Battles",
+ "winrate": "Winrate",
+ "account_id": "Account ID",
+ "created": "Created",
+ "last_battle": "Last battle"
+ }
}
}
},
From 77d6c93b905dd0149fea4ae0c079d7cd2ad33443 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com>
Date: Fri, 8 Mar 2024 20:43:31 -0600
Subject: [PATCH 72/90] New translations en-us.json (Croatian (disambiguation))
---
src/lang/hr.json | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/lang/hr.json b/src/lang/hr.json
index 8275a9782..7909741fe 100644
--- a/src/lang/hr.json
+++ b/src/lang/hr.json
@@ -413,6 +413,19 @@
"description": "Ping World of Tanks Blitz"
}
}
+ },
+ "player_info": {
+ "$": "player-info",
+ "description": "Basic information about a player",
+ "body": {
+ "title": "%'s information",
+ "nickname": "Nickname",
+ "battles": "Battles",
+ "winrate": "Winrate",
+ "account_id": "Account ID",
+ "created": "Created",
+ "last_battle": "Last battle"
+ }
}
}
},
From b8be5d5e384c9c21d70d8e6cc30b71e542ff66a4 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 05:11:15 -0600
Subject: [PATCH 73/90] New translations en-us.json (Spanish)
---
src/lang/es-ES.json | 88 ++++++++++++++++++++++-----------------------
1 file changed, 44 insertions(+), 44 deletions(-)
diff --git a/src/lang/es-ES.json b/src/lang/es-ES.json
index 2c606faf1..a44f49836 100644
--- a/src/lang/es-ES.json
+++ b/src/lang/es-ES.json
@@ -1,14 +1,14 @@
{
"common": {
"wn8_percentile": {
- "0": "Very bad",
- "1": "Bad",
- "2": "Below average",
- "3": "Average",
- "4": "Above average",
- "5": "Good",
- "6": "Very good",
- "7": "Great",
+ "0": "Muy malo",
+ "1": "Malo",
+ "2": "Inferior al promedio",
+ "3": "Promedio",
+ "4": "Superior al promedio",
+ "5": "Bueno",
+ "6": "Muy bueno",
+ "7": "Genial",
"8": "Unicum",
"9": "Super unicum"
},
@@ -38,7 +38,7 @@
"normal": {
"com": "Norteamérica",
"eu": "Europa",
- "asia": "Asia-Pacific"
+ "asia": "Asia-Pacífico"
},
"short": {
"com": "NA",
@@ -137,10 +137,10 @@
"description": "Región"
},
"tier": {
- "$": "tier",
- "description": "Tier",
+ "$": "nivel",
+ "description": "Nivel",
"choices": {
- "tier": "Tier %s - %s"
+ "tier": "Nivel %s - %s"
}
}
},
@@ -286,7 +286,7 @@
"accounts_linked": "Cuentas vinculadas",
"no_role_permissions": {
"$": "%s no se pudo verificar",
- "description": "I don't have the permission to manage roles."
+ "description": "No tengo los permisos para administrar los roles."
}
},
"embed": {
@@ -362,43 +362,43 @@
}
},
"today": {
- "$": "today",
- "description": "Today's played tanks and statistics"
+ "$": "hoy",
+ "description": "Tanques jugados hoy y estadísticas"
},
"stats": {
- "$": "stats",
- "description": "Quick statistics for a period",
+ "$": "estad",
+ "description": "Estadísticas rápidas para un período",
"body": {
- "battles": "Battles",
- "winrate": "Winrate",
- "damage": "Damage",
- "damage_ratio": "Damage ratio",
- "tier": "Tier",
- "survival": "Survival",
- "accuracy": "Accuracy",
- "kill_ratio": "Kill ratio"
+ "battles": "Batallas",
+ "winrate": "Tasa de victorias",
+ "damage": "Daño",
+ "damage_ratio": "Relación de daño",
+ "tier": "Nivel",
+ "survival": "Supervivencia",
+ "accuracy": "Precisión",
+ "kill_ratio": "Relación de bajas"
}
},
"owned_tanks": {
- "$": "owned-tanks",
- "description": "Shows all own tanks in a tier",
+ "$": "tanques-propios",
+ "description": "Muestra todos los tanques propios de un nivel",
"body": {
- "subtitle": "Tier %s tanks"
+ "subtitle": "Tanques de nivel %s"
}
},
"permissions": {
- "$": "permissions",
- "description": "Checks wether the bot has the required permissions to function",
+ "$": "permisos",
+ "description": "Comprueba si el bot tiene los permisos requeridos para funcionar",
"body": {
- "title": "# Permissions\n\n%s",
- "view_channels": "View channels: needed for the refresh button to work",
- "read_message_history": "Read message history: needed for the refresh button to find the message to refresh",
- "attach_files": "Attach files: needed for image-based commands to work"
+ "title": "# Permisos\n\n%s",
+ "view_channels": "Ver canales: necesario para que funcione el botón \"actualizar\"",
+ "read_message_history": "Leer el historial de mensajes: necesario para que el botón \"actualizar\" pueda encontrar el mensaje a actualizar",
+ "attach_files": "Adjuntar archivos: necesario para que funcionen los comandos basados en imágenes"
}
},
"ping": {
"$": "ping",
- "description": "Check wether the bot is alive.",
+ "description": "Comprueba si el bot está vivo.",
"body": {
"pong": "Pong 🏓",
"pong_with_time": "Pong 🏓 - %sms"
@@ -406,7 +406,7 @@
"subcommands": {
"blitzkrieg": {
"$": "blitzkrieg",
- "description": "Ping Blitzkrieg"
+ "description": "Hacer ping a Blitzkrieg"
},
"wotb": {
"$": "wotb",
@@ -415,16 +415,16 @@
}
},
"player_info": {
- "$": "player-info",
- "description": "Basic information about a player",
+ "$": "inf-jugador",
+ "description": "Información básica sobre un jugador",
"body": {
"title": "%'s information",
- "nickname": "Nickname",
- "battles": "Battles",
- "winrate": "Winrate",
- "account_id": "Account ID",
- "created": "Created",
- "last_battle": "Last battle"
+ "nickname": "Apodo",
+ "battles": "Batallas",
+ "winrate": "Tasa de victorias",
+ "account_id": "ID de cuenta",
+ "created": "Creado",
+ "last_battle": "Última batalla"
}
}
}
From fe249e270429edf23acd600725128b1cbeb54340 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 07:21:28 -0600
Subject: [PATCH 74/90] New translations en-us.json (Croatian (disambiguation))
---
src/lang/hr.json | 118 +++++++++++++++++++++++------------------------
1 file changed, 59 insertions(+), 59 deletions(-)
diff --git a/src/lang/hr.json b/src/lang/hr.json
index 7909741fe..4fc1cb78b 100644
--- a/src/lang/hr.json
+++ b/src/lang/hr.json
@@ -1,44 +1,44 @@
{
"common": {
"wn8_percentile": {
- "0": "Very bad",
- "1": "Bad",
- "2": "Below average",
- "3": "Average",
- "4": "Above average",
- "5": "Good",
- "6": "Very good",
- "7": "Great",
- "8": "Unicum",
- "9": "Super unicum"
+ "0": "Jako loše",
+ "1": "Loše",
+ "2": "Ispod prosečnog",
+ "3": "Prosečno",
+ "4": "Nad prosečno",
+ "5": "Dobro",
+ "6": "Jako dobro",
+ "7": "Super",
+ "8": "Legendarno",
+ "9": "Super Legendarno"
},
"nations": {
- "ussr": "U.S.S.R.",
- "germany": "Germany",
- "usa": "U.S.A.",
- "china": "China",
- "uk": "U.K.",
- "france": "France",
+ "ussr": "S.S.S.R.",
+ "germany": "Nemačka",
+ "usa": "S.A.D.",
+ "china": "Kina",
+ "uk": "Vel. Brit.",
+ "france": "Francuska",
"japan": "Japan",
- "european": "European nation",
- "other": "Hybrid nation"
+ "european": "Evropska Unija",
+ "other": "Hibridna nacija"
},
"tank_class_short": {
- "lightTank": "Light",
- "mediumTank": "Medium",
- "heavyTank": "Heavy",
+ "lightTank": "Svetlo",
+ "mediumTank": "Prosečno",
+ "heavyTank": "Teško",
"AT-SPG": "TD"
},
"tree_type": {
- "researchable": "Tech tree",
- "premium": "Premium",
- "collector": "Collector"
+ "researchable": "Razvojna tabla",
+ "premium": "Premijum",
+ "collector": "Kolektor"
},
"regions": {
"normal": {
- "com": "North America",
- "eu": "Europe",
- "asia": "Asia-Pacific"
+ "com": "Severna Amerika",
+ "eu": "Evropa",
+ "asia": "Azija-Pasifik"
},
"short": {
"com": "NA",
@@ -47,32 +47,32 @@
}
},
"leagues": {
- "diamond": "Diamond",
- "platinum": "Platinum",
- "gold": "Gold",
- "silver": "Silver",
- "bronze": "Bronze"
+ "diamond": "Dijamant",
+ "platinum": "Platina",
+ "gold": "Zlato",
+ "silver": "Srebro",
+ "bronze": "Bronza"
}
},
"bot": {
"common": {
"wn8": {
"$": "WN8",
- "very_bad": "Very bad",
- "bad": "Bad",
- "below_average": "Below average",
- "average": "Average",
- "above_average": "Above average",
- "good": "Good",
- "very_good": "Very good",
- "great": "Great",
- "unicum": "Unicum",
- "super_unicum": "Super unicum"
+ "very_bad": "Jako loše",
+ "bad": "Loše",
+ "below_average": "Ispod prosečnog",
+ "average": "Prosečno",
+ "above_average": "Nad prosečno",
+ "good": "Dobro",
+ "very_good": "Jako dobro",
+ "great": "Super",
+ "unicum": "Legendarno",
+ "super_unicum": "Super Legendarno"
},
"subcommands": {
"today": {
- "$": "today",
- "description": "Today"
+ "$": "danas",
+ "description": "Danas"
},
"30": {
"$": "30",
@@ -172,40 +172,40 @@
},
"embeds": {
"$": "embeds",
- "description": "How embeds work"
+ "description": "Kako embed radi"
},
"introduction": {
- "$": "introduction",
- "description": "About the bot"
+ "$": "uvod",
+ "description": "O bot-u"
},
"invite": {
- "$": "invite",
- "description": "How to invite the bot"
+ "$": "pozovi",
+ "description": "Kako pozvati robota"
},
"timezones": {
- "$": "timezones",
- "description": "How Blitzkrieg infers and uses your timezone"
+ "$": "vremenske zone",
+ "description": "Kako \"Blitzkrieg\" koristi podatke o tvojoj vremenskoj zoni"
},
"creators": {
- "$": "creators",
- "description": "People who have worked on the bot"
+ "$": "stvarači",
+ "description": "Ljudi koji su radili na robotu"
}
}
},
"breakdown": {
- "$": "breakdown",
+ "$": "analiza",
"description": "A period's breakdown by tanks played",
"body": {
"total": "Total",
- "battles": "Battles",
+ "battles": "Borbe",
"wn8": "WN8",
- "winrate": "Winrate",
- "damage": "Damage",
- "unknown_tank": "Unknown tank %s"
+ "winrate": "Procenat pobede",
+ "damage": "Šteta",
+ "unknown_tank": "Ne poznat tenk %s"
}
},
"debug": {
- "$": "debug",
+ "$": "odklanjanje grešaka",
"description": "Debug information about the bot",
"body": {
"title": "# Debug\n\n",
From 169e89267899c3305ed3da37d3442cf8a51a8a47 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 09:37:16 -0600
Subject: [PATCH 75/90] New translations en-us.json (Spanish)
---
src/lang/es-ES.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lang/es-ES.json b/src/lang/es-ES.json
index a44f49836..f1322fe61 100644
--- a/src/lang/es-ES.json
+++ b/src/lang/es-ES.json
@@ -418,7 +418,7 @@
"$": "inf-jugador",
"description": "Información básica sobre un jugador",
"body": {
- "title": "%'s information",
+ "title": "Información de %s",
"nickname": "Apodo",
"battles": "Batallas",
"winrate": "Tasa de victorias",
From 0f0bc9569d5a0fbbce7041562cef4c0614880e43 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 10:47:32 -0600
Subject: [PATCH 76/90] New translations en-us.json (Spanish)
---
src/lang/es-ES.json | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/lang/es-ES.json b/src/lang/es-ES.json
index f1322fe61..b15d03953 100644
--- a/src/lang/es-ES.json
+++ b/src/lang/es-ES.json
@@ -137,10 +137,10 @@
"description": "Región"
},
"tier": {
- "$": "nivel",
- "description": "Nivel",
+ "$": "tier",
+ "description": "Tier",
"choices": {
- "tier": "Nivel %s - %s"
+ "tier": "Tier %s - %s"
}
}
},
@@ -286,7 +286,7 @@
"accounts_linked": "Cuentas vinculadas",
"no_role_permissions": {
"$": "%s no se pudo verificar",
- "description": "No tengo los permisos para administrar los roles."
+ "description": "No tengo permiso para administrar roles."
}
},
"embed": {
@@ -366,14 +366,14 @@
"description": "Tanques jugados hoy y estadísticas"
},
"stats": {
- "$": "estad",
+ "$": "estadísticas",
"description": "Estadísticas rápidas para un período",
"body": {
"battles": "Batallas",
"winrate": "Tasa de victorias",
"damage": "Daño",
"damage_ratio": "Relación de daño",
- "tier": "Nivel",
+ "tier": "Tier",
"survival": "Supervivencia",
"accuracy": "Precisión",
"kill_ratio": "Relación de bajas"
@@ -381,9 +381,9 @@
},
"owned_tanks": {
"$": "tanques-propios",
- "description": "Muestra todos los tanques propios de un nivel",
+ "description": "Muestra todos los tanques propios en un tier",
"body": {
- "subtitle": "Tanques de nivel %s"
+ "subtitle": "Tanques de tier %s"
}
},
"permissions": {
@@ -391,8 +391,8 @@
"description": "Comprueba si el bot tiene los permisos requeridos para funcionar",
"body": {
"title": "# Permisos\n\n%s",
- "view_channels": "Ver canales: necesario para que funcione el botón \"actualizar\"",
- "read_message_history": "Leer el historial de mensajes: necesario para que el botón \"actualizar\" pueda encontrar el mensaje a actualizar",
+ "view_channels": "Ver canales: necesario para que funcione el botón de actualizar",
+ "read_message_history": "Leer el historial de mensajes: necesario para que el botón de actualizar pueda encontrar el mensaje a actualizar",
"attach_files": "Adjuntar archivos: necesario para que funcionen los comandos basados en imágenes"
}
},
@@ -406,16 +406,16 @@
"subcommands": {
"blitzkrieg": {
"$": "blitzkrieg",
- "description": "Hacer ping a Blitzkrieg"
+ "description": "Hacerle un ping a Blitzkrieg"
},
"wotb": {
"$": "wotb",
- "description": "Ping World of Tanks Blitz"
+ "description": "Hacerle un ping a World of Tanks Blitz"
}
}
},
"player_info": {
- "$": "inf-jugador",
+ "$": "info-jugador",
"description": "Información básica sobre un jugador",
"body": {
"title": "Información de %s",
From 607ebc002574ccbd8723038566958ffc5ababff1 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 10:47:33 -0600
Subject: [PATCH 77/90] New translations en-us.json (Croatian (disambiguation))
---
src/lang/hr.json | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/lang/hr.json b/src/lang/hr.json
index 4fc1cb78b..0b34a77dc 100644
--- a/src/lang/hr.json
+++ b/src/lang/hr.json
@@ -76,30 +76,30 @@
},
"30": {
"$": "30",
- "description": "30 days"
+ "description": "30 dana"
},
"60": {
"$": "60",
- "description": "60 days"
+ "description": "60 dana"
},
"90": {
"$": "90",
- "description": "90 days"
+ "description": "90 dana"
},
"career": {
- "$": "career",
- "description": "Career"
+ "$": "karijera",
+ "description": "Karijera"
},
"custom": {
- "$": "custom",
- "description": "Custom range",
+ "$": "proizvoljno",
+ "description": "Proizvoljna daljina",
"options": {
"start": {
- "$": "start",
+ "$": "kreni",
"description": "Start in number of days ago from today"
},
"end": {
- "$": "end",
+ "$": "kraj",
"description": "End in number of days ago from today"
}
}
@@ -107,7 +107,7 @@
},
"options": {
"clan": {
- "$": "clan",
+ "$": "klan",
"description": "The clan name or tag"
},
"tank": {
From 265eff98bf41ad9caca3b6bea266a687bd2ef9e4 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 11:31:45 -0600
Subject: [PATCH 78/90] fix: change name to rad
---
.../tankopedia/[id]/components/Model/components/TankModel.tsx | 2 +-
src/core/blitz/applyPitchYawLimits.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx b/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx
index e5253be2e..84a7ac601 100644
--- a/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx
+++ b/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx
@@ -10,7 +10,7 @@ import {
ModelTransformEventData,
modelTransformEvent,
} from '../../../../../../../core/blitzkrieg/modelTransform';
-import { normalizeAngleRad } from '../../../../../../../core/math/normalizeAngleRad';
+import { normalizeAngleRad } from '../../../../../../../core/math/normalizeAngleRAD';
import { useAwait } from '../../../../../../../hooks/useAwait';
import { useModel } from '../../../../../../../hooks/useModel';
import { mutateDuel, useDuel } from '../../../../../../../stores/duel';
diff --git a/src/core/blitz/applyPitchYawLimits.ts b/src/core/blitz/applyPitchYawLimits.ts
index 7565ac3bf..06ca4421b 100644
--- a/src/core/blitz/applyPitchYawLimits.ts
+++ b/src/core/blitz/applyPitchYawLimits.ts
@@ -1,6 +1,6 @@
import { clamp } from 'lodash';
import { PitchLimits, YawLimits } from '../blitzkrieg/modelDefinitions';
-import { normalizeAngleRad } from '../math/normalizeAngleRad';
+import { normalizeAngleRad } from '../math/normalizeAngleRAD';
export function applyPitchYawLimits(
pitch: number, // rad
From 889ae39e3ba5137ee1c6267ce904e92daf35ab8b 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 11:48:35 -0600
Subject: [PATCH 79/90] feat: user error strings
---
src/commands/breakdown.tsx | 4 +-
src/commands/evolution.tsx | 6 +-
src/commands/fullStats.tsx | 8 +-
src/commands/ownedTanks.tsx | 2 +-
src/commands/stats.tsx | 8 +-
src/core/blitz/getTankStats.ts | 13 +-
src/core/blitz/resolveTankId.ts | 16 +-
src/core/blitzkrieg/getTankHistories.ts | 4 +-
src/core/blitzstars/getStatsInPeriod.ts | 4 +-
src/core/discord/getFiltersFromCommand.ts | 5 +-
src/core/discord/resolveClanFromCommand.ts | 4 +-
src/core/discord/resolvePlayerFromCommand.ts | 12 +-
src/lang/en-US.json | 11 +-
src/lang/hr-HR.json | 348 -------------------
14 files changed, 71 insertions(+), 374 deletions(-)
delete mode 100644 src/lang/hr-HR.json
diff --git a/src/commands/breakdown.tsx b/src/commands/breakdown.tsx
index 2eb6a3af1..a231eda2d 100644
--- a/src/commands/breakdown.tsx
+++ b/src/commands/breakdown.tsx
@@ -51,11 +51,11 @@ export async function renderBreakdown(
const { t, translate } = translator(locale);
const awaitedTankDefinitions = await tankDefinitions;
const awaitedTankAverages = await tankAverages;
- const statsInPeriod = await getStatsInPeriod(region, id, start, end);
+ const statsInPeriod = await getStatsInPeriod(region, id, start, end, locale);
const { filteredOrder } = await filterStats(statsInPeriod, filters);
const accountInfo = await getAccountInfo(region, id);
const clanData = await getClanAccountInfo(region, id, ['clan']);
- const tankStats = await getTankStats(region, id);
+ const tankStats = await getTankStats(region, id, locale);
const filterDescriptions = await filtersToDescription(filters, locale);
const orderedCurrentStats: AllStats[] = [];
const orderedCareerStats: AllStats[] = [];
diff --git a/src/commands/evolution.tsx b/src/commands/evolution.tsx
index fce791045..52dd4c4d4 100644
--- a/src/commands/evolution.tsx
+++ b/src/commands/evolution.tsx
@@ -48,7 +48,7 @@ async function render(
includeLatestHistories: true,
includePreviousHistories: true,
})
- : getTankHistories(region, id, {
+ : getTankHistories(region, id, locale, {
tankId: tankId!,
start,
end,
@@ -140,7 +140,9 @@ export const evolutionCommand = new Promise(
const period = resolvePeriodFromCommand(player.region, interaction);
const tankIdRaw = interaction.options.getString('tank')!;
const tankId =
- commandGroup === 'tank' ? await resolveTankId(tankIdRaw) : null;
+ commandGroup === 'tank'
+ ? await resolveTankId(tankIdRaw, interaction.locale)
+ : null;
const path = commandToURL(interaction, {
...player,
...getCustomPeriodParams(interaction),
diff --git a/src/commands/fullStats.tsx b/src/commands/fullStats.tsx
index df7d870d9..2463fb113 100644
--- a/src/commands/fullStats.tsx
+++ b/src/commands/fullStats.tsx
@@ -41,7 +41,13 @@ async function render(
const { nickname } = await getAccountInfo(region, id);
const clan = (await getClanAccountInfo(region, id, ['clan']))?.clan;
const clanImage = clan ? emblemIdToURL(clan.emblem_set_id) : undefined;
- const diffedTankStats = await getStatsInPeriod(region, id, start, end);
+ const diffedTankStats = await getStatsInPeriod(
+ region,
+ id,
+ start,
+ end,
+ locale,
+ );
const { stats, supplementary, filteredOrder } = await filterStats(
diffedTankStats,
filters,
diff --git a/src/commands/ownedTanks.tsx b/src/commands/ownedTanks.tsx
index d8e0d1abd..3b5f41033 100644
--- a/src/commands/ownedTanks.tsx
+++ b/src/commands/ownedTanks.tsx
@@ -37,7 +37,7 @@ export const ownedTanksCommand = new Promise((resolve) => {
const account = await resolvePlayerFromCommand(interaction);
const { id, region: server } = account;
const accountInfo = await getAccountInfo(server, id);
- const tankStats = await getTankStats(server, id);
+ const tankStats = await getTankStats(server, id, interaction.locale);
const filteredTanks = (
await Promise.all(
tankStats.map(async (tankData) => ({
diff --git a/src/commands/stats.tsx b/src/commands/stats.tsx
index 060bc9f6c..eb909643e 100644
--- a/src/commands/stats.tsx
+++ b/src/commands/stats.tsx
@@ -39,7 +39,13 @@ async function render(
const { nickname } = await getAccountInfo(region, id);
const clan = (await getClanAccountInfo(region, id, ['clan']))?.clan;
const clanImage = clan ? emblemIdToURL(clan.emblem_set_id) : undefined;
- const diffedTankStats = await getStatsInPeriod(region, id, start, end);
+ const diffedTankStats = await getStatsInPeriod(
+ region,
+ id,
+ start,
+ end,
+ locale,
+ );
const { stats, supplementary } = await filterStats(diffedTankStats, filters);
const filterDescriptions = await filtersToDescription(filters, locale);
diff --git a/src/core/blitz/getTankStats.ts b/src/core/blitz/getTankStats.ts
index be11ffe10..918afc7ee 100644
--- a/src/core/blitz/getTankStats.ts
+++ b/src/core/blitz/getTankStats.ts
@@ -1,18 +1,23 @@
+import { Locale } from 'discord.js';
import { Region } from '../../constants/regions';
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
import { UserError } from '../../hooks/userError';
import { TanksStats } from '../../types/tanksStats';
+import { translator } from '../localization/translator';
import fetchBlitz from './fetchBlitz';
-export default async function getTankStats(region: Region, id: number) {
+export default async function getTankStats(
+ region: Region,
+ id: number,
+ locale: Locale,
+) {
+ const { t } = translator(locale);
const tankStats = await fetchBlitz(
`https://api.wotblitz.${region}/wotb/tanks/stats/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}`,
);
if (tankStats[id] === null) {
- throw new UserError(
- "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for.",
- );
+ throw new UserError(t`bot.common.errors.no_tank_stats`);
}
return tankStats[id];
diff --git a/src/core/blitz/resolveTankId.ts b/src/core/blitz/resolveTankId.ts
index c9d555d98..ee4883ee8 100644
--- a/src/core/blitz/resolveTankId.ts
+++ b/src/core/blitz/resolveTankId.ts
@@ -1,12 +1,18 @@
+import { Locale } from 'discord.js';
import { go } from 'fuzzysort';
-import { UserError } from '../../hooks/userError';
import markdownEscape from 'markdown-escape';
+import { UserError } from '../../hooks/userError';
import {
tankDefinitions,
tanksDefinitionsArray,
} from '../blitzkrieg/tankDefinitions';
+import { translator } from '../localization/translator';
-export default async function resolveTankId(tank: string | number) {
+export default async function resolveTankId(
+ tank: string | number,
+ locale: Locale,
+) {
+ const { translate } = translator(locale);
const number = typeof tank === 'string' ? parseInt(tank) : tank;
if (Number.isNaN(number)) {
@@ -17,7 +23,9 @@ export default async function resolveTankId(tank: string | number) {
if (searchResult.length === 0) {
throw new UserError(
- `# Tank not found\nCould not find tank by the name "${markdownEscape(`${tank}`)}".`,
+ translate('bot.common.errors.tank_name_not_found', [
+ markdownEscape(`${tank}`),
+ ]),
);
} else {
return searchResult[0].obj.id;
@@ -27,7 +35,7 @@ export default async function resolveTankId(tank: string | number) {
return number;
} else {
throw new UserError(
- `# Tank not found\nCould not find tank by the ID "${number}". Try typing the name of the tank instead of a number.`,
+ translate('bot.common.errors.tank_id_not_found', [`${number}`]),
);
}
}
diff --git a/src/core/blitzkrieg/getTankHistories.ts b/src/core/blitzkrieg/getTankHistories.ts
index 8ee89de4d..542a777c7 100644
--- a/src/core/blitzkrieg/getTankHistories.ts
+++ b/src/core/blitzkrieg/getTankHistories.ts
@@ -1,3 +1,4 @@
+import { Locale } from 'discord.js';
import { Region } from '../../constants/regions';
import {
GetHistoriesOptions,
@@ -34,6 +35,7 @@ export const getTankHistoriesDefaultOptions: GetTankHistoriesOptions = {
export default async function getTankHistories(
server: Region,
id: number,
+ locale: Locale,
options?: Partial,
) {
const mergedOptions = { ...getTankHistoriesDefaultOptions, ...options };
@@ -76,7 +78,7 @@ export default async function getTankHistories(
const latestNodes: TankHistories = [];
if (mergedOptions.includeLatestHistories) {
- (await getTankStats(server, id)).forEach((tankHistory) => {
+ (await getTankStats(server, id, locale)).forEach((tankHistory) => {
if (
tankHistory.all.battles > (lastBattles[tankHistory.tank_id] ?? 0) &&
(mergedOptions.tankId === undefined ||
diff --git a/src/core/blitzstars/getStatsInPeriod.ts b/src/core/blitzstars/getStatsInPeriod.ts
index 0a703ff07..9b20c2e64 100644
--- a/src/core/blitzstars/getStatsInPeriod.ts
+++ b/src/core/blitzstars/getStatsInPeriod.ts
@@ -1,3 +1,4 @@
+import { Locale } from 'discord.js';
import { Region } from '../../constants/regions';
import { AllStats } from '../blitz/getAccountInfo';
import getTankHistories, {
@@ -45,8 +46,9 @@ export default async function getStatsInPeriod(
id: number,
start: number,
end: number,
+ locale: Locale,
) {
- const history = await getTankHistories(server, id, {
+ const history = await getTankHistories(server, id, locale, {
includeLatestHistories: true,
});
diff --git a/src/core/discord/getFiltersFromCommand.ts b/src/core/discord/getFiltersFromCommand.ts
index 171316635..0ebf09157 100644
--- a/src/core/discord/getFiltersFromCommand.ts
+++ b/src/core/discord/getFiltersFromCommand.ts
@@ -15,6 +15,9 @@ export async function getFiltersFromCommand(
treeType:
(interaction.options.getString('tree-type') as TreeType | undefined) ??
undefined,
- tank: tankRaw === null ? undefined : await resolveTankId(tankRaw),
+ tank:
+ tankRaw === null
+ ? undefined
+ : await resolveTankId(tankRaw, interaction.locale),
} satisfies StatFilters;
}
diff --git a/src/core/discord/resolveClanFromCommand.ts b/src/core/discord/resolveClanFromCommand.ts
index 1efe29028..ff2e709c5 100644
--- a/src/core/discord/resolveClanFromCommand.ts
+++ b/src/core/discord/resolveClanFromCommand.ts
@@ -3,11 +3,13 @@ import markdownEscape from 'markdown-escape';
import { Region } from '../../constants/regions';
import { UserError } from '../../hooks/userError';
import searchClansAcrossRegions from '../blitz/searchClansAcrossRegions';
+import { translator } from '../localization/translator';
import { serverAndIdPattern } from './resolvePlayerFromCommand';
export default async function resolveClanFromCommand(
interaction: ChatInputCommandInteraction,
) {
+ const { translate } = translator(interaction.locale);
const clan = interaction.options.getString('clan', true);
if (serverAndIdPattern.test(clan)) {
@@ -20,7 +22,7 @@ export default async function resolveClanFromCommand(
return { region: accounts[0].region, id: accounts[0].clan_id };
} else {
throw new UserError(
- `# Could not find clan\nCouldn't find "${markdownEscape(clan)}". Try selecting a clan from the search result.`,
+ translate('bot.common.errors.clan_not_found', [markdownEscape(clan)]),
);
}
}
diff --git a/src/core/discord/resolvePlayerFromCommand.ts b/src/core/discord/resolvePlayerFromCommand.ts
index 93d6bc3b9..74044a20e 100644
--- a/src/core/discord/resolvePlayerFromCommand.ts
+++ b/src/core/discord/resolvePlayerFromCommand.ts
@@ -4,6 +4,7 @@ import { Region } from '../../constants/regions';
import { UserError } from '../../hooks/userError';
import searchPlayersAcrossRegions from '../blitz/searchPlayersAcrossRegions';
import { getBlitzFromDiscord } from '../blitzkrieg/discordBlitz';
+import { translator } from '../localization/translator';
export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
@@ -15,6 +16,7 @@ export interface ResolvedPlayer {
export default async function resolvePlayerFromCommand(
interaction: ChatInputCommandInteraction,
) {
+ const { t, translate } = translator(interaction.locale);
const commandUsername = interaction.options.getString('username');
if (commandUsername) {
@@ -35,9 +37,9 @@ export default async function resolvePlayerFromCommand(
} satisfies ResolvedPlayer;
} else {
throw new UserError(
- `# Could not find user\nI couldn't find user "${markdownEscape(
- commandUsername,
- )}". Try picking an user from the search result, typing in a valid username, or using the \`/link\` command.`,
+ translate('bot.common.errors.player_not_found', [
+ markdownEscape(commandUsername),
+ ]),
);
}
}
@@ -47,9 +49,7 @@ export default async function resolvePlayerFromCommand(
if (account) {
return { region: account.region, id: account.blitz };
} else {
- throw new UserError(
- "# I don't know who you are\nUse the `/link` command to get started.",
- );
+ throw new UserError(t`bot.common.errors.player_not_linked`);
}
}
}
diff --git a/src/lang/en-US.json b/src/lang/en-US.json
index c438702a2..9aeab2dbc 100644
--- a/src/lang/en-US.json
+++ b/src/lang/en-US.json
@@ -176,6 +176,15 @@
"battles_in_period": "No battles played in this period",
"players_in_period": "No players in this period",
"tanks_found": "No tanks found"
+ },
+
+ "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.",
+ "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."
}
},
@@ -478,7 +487,7 @@
"description": "Basic information about a player",
"body": {
- "title": "%'s information",
+ "title": "%s's information",
"nickname": "Nickname",
"battles": "Battles",
"winrate": "Winrate",
diff --git a/src/lang/hr-HR.json b/src/lang/hr-HR.json
deleted file mode 100644
index 483211636..000000000
--- a/src/lang/hr-HR.json
+++ /dev/null
@@ -1,348 +0,0 @@
-{
- "common": {
- "nations": {
- "ussr": "U.S.S.R.",
- "germany": "Germany",
- "usa": "U.S.A.",
- "china": "China",
- "uk": "U.K.",
- "france": "France",
- "japan": "Japan",
- "european": "European nation",
- "other": "Hybrid nation"
- },
- "tank_class_short": {
- "lightTank": "Light",
- "mediumTank": "Medium",
- "heavyTank": "Heavy",
- "AT-SPG": "TD"
- },
- "tree_type": {
- "researchable": "Tech tree",
- "premium": "Premium",
- "collector": "Collector"
- },
- "regions": {
- "normal": {
- "com": "North America",
- "eu": "Europe",
- "asia": "Asia-Pacific"
- },
- "short": {
- "com": "NA",
- "eu": "EU",
- "asia": "APAC"
- }
- },
- "leagues": {
- "diamond": "Diamond",
- "platinum": "Platinum",
- "gold": "Gold",
- "silver": "Silver",
- "bronze": "Bronze"
- }
- },
- "bot": {
- "common": {
- "wn8": {
- "$": "WN8",
- "very_bad": "Very bad",
- "bad": "Bad",
- "below_average": "Below average",
- "average": "Average",
- "above_average": "Above average",
- "good": "Good",
- "very_good": "Very good",
- "great": "Great",
- "unicum": "Unicum",
- "super_unicum": "Super unicum"
- },
- "subcommands": {
- "today": {
- "$": "today",
- "description": "Today"
- },
- "30": {
- "$": "30",
- "description": "30 days"
- },
- "60": {
- "$": "60",
- "description": "60 days"
- },
- "90": {
- "$": "90",
- "description": "90 days"
- },
- "career": {
- "$": "career",
- "description": "Career"
- },
- "custom": {
- "$": "custom",
- "description": "Custom range",
- "options": {
- "start": {
- "$": "start",
- "description": "Start in number of days ago from today"
- },
- "end": {
- "$": "end",
- "description": "End in number of days ago from today"
- }
- }
- }
- },
- "options": {
- "clan": {
- "$": "clan",
- "description": "The clan name or tag"
- },
- "tank": {
- "$": "tank",
- "description": "The tank to get stats for"
- },
- "username": {
- "$": "username",
- "description": "The Blitz username of the player"
- },
- "filters": {
- "nation": {
- "$": "nation",
- "description": "Nation"
- },
- "tank_class": {
- "$": "tank-class",
- "description": "Tank class"
- },
- "tree_type": {
- "$": "tree-type",
- "description": "Tree type"
- }
- },
- "region": {
- "$": "region",
- "description": "Region"
- }
- },
- "periods": {
- "career": "Career",
- "today": "Today",
- "days": "%s days",
- "custom": "%s - %s days"
- },
- "filters": {
- "none": "No filters",
- "tier": "Tier %s"
- },
- "no_data": {
- "battles_in_period": "No battles played in this period",
- "players_in_period": "No players in this period",
- "tanks_found": "No tanks found"
- }
- },
- "commands": {
- "about": {
- "$": "about",
- "description": "All the info you need about the bot",
- "subcommands": {
- "commands": {
- "$": "commands",
- "description": "List of all commands and their descriptions",
- "body": "# Commands\n\nBlitzkrieg offers the following commands:\n\n"
- },
- "embeds": {
- "$": "embeds",
- "description": "How embeds work"
- },
- "introduction": {
- "$": "introduction",
- "description": "About the bot"
- },
- "invite": {
- "$": "invite",
- "description": "How to invite the bot"
- },
- "timezones": {
- "$": "timezones",
- "description": "How Blitzkrieg infers and uses your timezone"
- },
- "creators": {
- "$": "creators",
- "description": "People who have worked on the bot"
- }
- }
- },
- "breakdown": {
- "$": "breakdown",
- "description": "A period's breakdown by tanks played",
- "body": {
- "total": "Total",
- "battles": "Battles",
- "wn8": "WN8",
- "winrate": "Winrate",
- "damage": "Damage",
- "unknown_tank": "Unknown tank %s"
- }
- },
- "debug": {
- "$": "debug",
- "description": "Debug information about the bot",
- "body": {
- "title": "# Debug\n\n",
- "version": "Version",
- "shard": {
- "$": "Shard",
- "default": "default"
- },
- "uptime": "Uptime"
- }
- },
- "evolution": {
- "$": "evolution",
- "description": "Evolution of statistics",
- "groups": {
- "player": {
- "$": "player",
- "description": "Player statistics"
- },
- "tank": {
- "$": "tank",
- "description": "Tank statistics"
- }
- }
- },
- "inactive": {
- "$": "inactive",
- "description": "Lists all inactive players in a clan above a threshold",
- "options": {
- "threshold": {
- "$": "threshold",
- "description": "The number of days inactive (default: %s days)"
- }
- },
- "body": {
- "subtitle": "Inactive for %s+ days",
- "listing": "%s days"
- }
- },
- "full_stats": {
- "$": "full-stats",
- "description": "Full in-game statistics",
- "body": {
- "cards": {
- "games": {
- "$": "Games",
- "winrate": "Winrate",
- "battles": "Battles",
- "wins_losses": "Wins / losses"
- },
- "efficiency": {
- "$": "Efficiency",
- "wn8": "WN8",
- "survival": "Survival",
- "accuracy": "Accuracy"
- },
- "lethality": {
- "$": "Lethality",
- "average_damage": "Average damage",
- "damage_per_tier": "Damage per tier",
- "damage_ratio": "Damage ratio",
- "average_kills": "Average kills"
- },
- "miscellaneous": {
- "$": "Miscellaneous",
- "average_tier": "Average tier",
- "average_spots": "Average spots",
- "average_xp": "Average XP",
- "kills_to_death_ratio": "Kills to death ratio"
- }
- }
- }
- },
- "link": {
- "$": "link",
- "description": "Links your Blitz and Discord account",
- "body": {
- "accounts_linked": "Accounts linked",
- "no_role_permissions": {
- "$": "%s failed to verify",
- "description": "I don't have the permission to manage roles."
- }
- },
- "embed": {
- "title": "Incorrect account?",
- "description": "Use the command again and select a username from the search results."
- }
- },
- "search_clans": {
- "$": "search-clans",
- "description": "Search clans",
- "options": {
- "limit": {
- "$": "limit",
- "description": "The max number of clan results (default: %s)"
- }
- },
- "body": {
- "title": "Clan search for %s in region %s",
- "no_results": "No clans found"
- }
- },
- "search_players": {
- "$": "search-players",
- "description": "Search players",
- "options": {
- "limit": {
- "$": "limit",
- "description": "The max number of player results (default: %s)"
- }
- },
- "body": {
- "title": "Player search for %s in region %s",
- "no_results": "No players found"
- }
- },
- "ratings": {
- "$": "ratings",
- "description": "Ratings battles statistics",
- "subcommands": {
- "neighbors": {
- "$": "neighbors",
- "description": "Neighboring players on the leaderboard"
- },
- "league": {
- "$": "league",
- "description": "Top players of a league"
- }
- },
- "options": {
- "limit": {
- "$": "limit",
- "description": "How many neighbors to display (default: %s)"
- },
- "season": {
- "$": "season",
- "description": "Season number (default: current)",
- "choices": {
- "current": "%s (current)"
- }
- },
- "league": {
- "$": "league",
- "description": "The league to display"
- }
- },
- "body": {
- "top_players": "Top %s players",
- "no_participation": "# %s didn't play ratings in season %s\n\nThis player did not participate in this season or did not get past calibration.",
- "no_ongoing_season": "# No ongoing season\n\nThere isn't a currently running ratings season.",
- "deleted_player": "Deleted %s",
- "neighbors": "Ratings neighbors",
- "more": "+%s more"
- }
- }
- }
- },
- "website": {}
-}
From 8e216ebe4695b26fa5bfc15970faac089c1a4684 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 11:50:47 -0600
Subject: [PATCH 80/90] fix: tighter numerical tank name inference
---
src/core/blitz/resolveTankId.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/blitz/resolveTankId.ts b/src/core/blitz/resolveTankId.ts
index ee4883ee8..6db757940 100644
--- a/src/core/blitz/resolveTankId.ts
+++ b/src/core/blitz/resolveTankId.ts
@@ -13,7 +13,7 @@ export default async function resolveTankId(
locale: Locale,
) {
const { translate } = translator(locale);
- const number = typeof tank === 'string' ? parseInt(tank) : tank;
+ const number = typeof tank === 'string' ? Number(tank) : tank;
if (Number.isNaN(number)) {
const searchResult = go(`${tank}`, await tanksDefinitionsArray, {
From 9840982aa2e3b0c37929a3e19c248de3ff1544d0 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:01:41 -0600
Subject: [PATCH 81/90] feat: more strings
---
.vscode/settings.json | 1 +
src/commands/ownedTanks.tsx | 5 ++---
src/events/interactionCreate/handlers/chatInputCommand.ts | 7 ++++---
src/lang/en-US.json | 4 +++-
4 files changed, 10 insertions(+), 7 deletions(-)
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."
}
},
From 9d6d893373b5b977d70e39d652bfbf3322b5fc87 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:02:17 -0600
Subject: [PATCH 82/90] feat: removed preview commands
---
.../interactionCreate/handlers/chatInputCommand.ts | 14 --------------
src/events/interactionCreate/index.ts | 1 -
2 files changed, 15 deletions(-)
diff --git a/src/events/interactionCreate/handlers/chatInputCommand.ts b/src/events/interactionCreate/handlers/chatInputCommand.ts
index e056cbbc2..a5842327b 100644
--- a/src/events/interactionCreate/handlers/chatInputCommand.ts
+++ b/src/events/interactionCreate/handlers/chatInputCommand.ts
@@ -8,7 +8,6 @@ import {
InteractionReplyOptions,
} from 'discord.js';
import { commands } from '..';
-import discord from '../../../../discord.json' assert { type: 'json' };
import buttonLink from '../../../core/discord/buttonLink';
import embedWarning from '../../../core/discord/embedWarning';
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
@@ -24,19 +23,6 @@ export default async function handleChatInputCommand(
await interaction.deferReply();
- if (registry.inPreview && interaction.guildId !== discord.tres_guild_id) {
- interaction.editReply({
- embeds: [
- embedWarning(
- `\`/${registry.command.name}\` is in Public Preview`,
- '[Join the official Discord server](https://discord.gg/nDt7AjGJQH) to gain early access to this command before it is released to the public.',
- ),
- ],
- });
-
- return;
- }
-
try {
const returnable = await registry.handler(interaction);
diff --git a/src/events/interactionCreate/index.ts b/src/events/interactionCreate/index.ts
index 3b3e8293e..5e18ebfd6 100644
--- a/src/events/interactionCreate/index.ts
+++ b/src/events/interactionCreate/index.ts
@@ -54,7 +54,6 @@ export type InteractionReturnable =
interface CommandRegistryBase {
inProduction: boolean;
inPublic: boolean;
- inPreview?: boolean;
command:
| SlashCommandBuilder
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 83/90] 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.",
From 43adaf85f5a80ff3a2afd1f573b0821ea1d1068e 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:10:44 -0600
Subject: [PATCH 84/90] fix: typos
---
src/commands/permissions.ts | 2 +-
src/commands/playerInfo.ts | 17 ++++++++++-------
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/commands/permissions.ts b/src/commands/permissions.ts
index 186119f29..c2916f13f 100644
--- a/src/commands/permissions.ts
+++ b/src/commands/permissions.ts
@@ -17,7 +17,7 @@ export const permissionsCommand = new Promise((resolve) => {
const permissions = [
[
interaction.appPermissions?.has('ViewChannel'),
- t`bot.commands.permissions.body.view_channel`,
+ t`bot.commands.permissions.body.view_channels`,
],
[
interaction.appPermissions?.has('ReadMessageHistory'),
diff --git a/src/commands/playerInfo.ts b/src/commands/playerInfo.ts
index f9db1c97f..cbb6b2cb4 100644
--- a/src/commands/playerInfo.ts
+++ b/src/commands/playerInfo.ts
@@ -24,18 +24,21 @@ export const playerInfoCommand = new Promise((resolve) => {
const accountInfo = await getAccountInfo(region, id);
return embedInfo(
- translate('bot.command.player_info.body.title', [
+ translate('bot.commands.player_info.body.title', [
markdownEscape(accountInfo.nickname),
]),
markdownTable([
- [t`bot.command.player_info.body.nickname`, `${accountInfo.nickname}`],
[
- t`bot.command.player_info.body.battles`,
+ t`bot.commands.player_info.body.nickname`,
+ `${accountInfo.nickname}`,
+ ],
+ [
+ t`bot.commands.player_info.body.battles`,
`${accountInfo.statistics.all.battles}`,
],
[
- t`bot.command.player_info.body.winrate`,
+ t`bot.commands.player_info.body.winrate`,
`${(
100 *
(accountInfo.statistics.all.wins /
@@ -44,17 +47,17 @@ export const playerInfoCommand = new Promise((resolve) => {
],
[],
[
- t`bot.command.player_info.body.account_id`,
+ t`bot.commands.player_info.body.account_id`,
`${accountInfo.account_id}`,
],
[
- t`bot.command.player_info.body.created`,
+ t`bot.commands.player_info.body.created`,
new Date(accountInfo.created_at * 1000).toLocaleDateString(
interaction.locale,
),
],
[
- t`bot.command.player_info.body.last_battle`,
+ t`bot.commands.player_info.body.last_battle`,
new Date(accountInfo.last_battle_time * 1000).toLocaleDateString(
interaction.locale,
),
From 70f1ebadfcabc6baa046760b17565f6f8ea8c6d9 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:10:49 -0600
Subject: [PATCH 85/90] New translations en-us.json (Spanish)
---
src/lang/es-ES.json | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/lang/es-ES.json b/src/lang/es-ES.json
index b15d03953..28ce124ce 100644
--- a/src/lang/es-ES.json
+++ b/src/lang/es-ES.json
@@ -158,6 +158,19 @@
"battles_in_period": "No hay batallas jugadas en este período",
"players_in_period": "No hay jugadores en este período",
"tanks_found": "No se encontraron tanques"
+ },
+ "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.",
+ "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.",
+ "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."
}
},
"commands": {
@@ -418,7 +431,7 @@
"$": "info-jugador",
"description": "Información básica sobre un jugador",
"body": {
- "title": "Información de %s",
+ "title": "%s's information",
"nickname": "Apodo",
"battles": "Batallas",
"winrate": "Tasa de victorias",
From db40256bb44c8efdc6742fb00483682e9226a126 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:10:50 -0600
Subject: [PATCH 86/90] New translations en-us.json (Croatian (disambiguation))
---
src/lang/hr.json | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/lang/hr.json b/src/lang/hr.json
index 0b34a77dc..f8a8ac694 100644
--- a/src/lang/hr.json
+++ b/src/lang/hr.json
@@ -158,6 +158,19 @@
"battles_in_period": "No battles played in this period",
"players_in_period": "No players in this period",
"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.",
+ "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.",
+ "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."
}
},
"commands": {
@@ -418,7 +431,7 @@
"$": "player-info",
"description": "Basic information about a player",
"body": {
- "title": "%'s information",
+ "title": "%s's information",
"nickname": "Nickname",
"battles": "Battles",
"winrate": "Winrate",
From d1308bc625da51fecd6ca6dfbfc39c9144450f9c 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 13:37:08 -0600
Subject: [PATCH 87/90] New translations en-us.json (Spanish)
---
src/lang/es-ES.json | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/lang/es-ES.json b/src/lang/es-ES.json
index 28ce124ce..324973e15 100644
--- a/src/lang/es-ES.json
+++ b/src/lang/es-ES.json
@@ -160,17 +160,17 @@
"tanks_found": "No se encontraron tanques"
},
"buttons": {
- "refresh": "Refresh"
+ "refresh": "Actualizar"
},
"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.",
- "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.",
- "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."
+ "clan_not_found": "# No se pudo encontrar el clan\nNo se pudo encontrar \"%s\". Prueba seleccionando un clan de los resultados de búsqueda.",
+ "player_not_found": "# No se pudo encontrar el usuario\nNo pude encontrar al usuario \"%s\". Prueba eligiendo un usuario de los resultados de búsqueda, escribiendo un nombre de usuario aceptable o usando el comando `/vincular`.",
+ "player_not_linked": "# No sé quién eres\nUsa el comando `/vincular` para comenzar.",
+ "tank_name_not_found": "# No se pudo encontrar el tanque\nNo se pudo encontrar el tanque con el nombre \"%s\".",
+ "tank_id_not_found": "# Tanque no encontrado\nNo se pudo encontrar al tanque del ID \"%s\". Prueba escribiendo el nombre del tanque en vez de un número.",
+ "no_tank_stats": "# No hay estadísticas de tanque disponibles\nEste jugador no tiene estadísticas disponibles. Este podría no ser el jugador que estás buscando.",
+ "get_help": "Servidor de ayuda de Discord",
+ "uncaught_error": "# ¡Blitzkrieg sufrió un error!\nLo sentimos mucho. Siéntete libre de [unirte al servidor oficial de Discord](https://discord.gg/nDt7AjGJQH) para obtener ayuda."
}
},
"commands": {
@@ -431,7 +431,7 @@
"$": "info-jugador",
"description": "Información básica sobre un jugador",
"body": {
- "title": "%s's information",
+ "title": "Información de %s",
"nickname": "Apodo",
"battles": "Batallas",
"winrate": "Tasa de victorias",
From 9d4b750dfd669bce975e65915507e1a0fc1aca1d 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 14:55:24 -0600
Subject: [PATCH 88/90] New translations en-us.json (Spanish)
---
src/lang/es-ES.json | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/lang/es-ES.json b/src/lang/es-ES.json
index 324973e15..6703c34a8 100644
--- a/src/lang/es-ES.json
+++ b/src/lang/es-ES.json
@@ -337,7 +337,7 @@
},
"ratings": {
"$": "clasificación",
- "description": "Estadísticas de batallas en Clasificación",
+ "description": "Estadísticas de batallas en clasificación",
"subcommands": {
"neighbors": {
"$": "vecinos",
@@ -367,10 +367,10 @@
},
"body": {
"top_players": "Top %s jugadores",
- "no_participation": "# %s no jugó Clasificación en la temporada %s\n\nEl jugador no participó en esta temporada o no completó su calibración.",
- "no_ongoing_season": "# No hay temporada en curso\n\nActualmente no hay ninguna temporada de Clasificación.",
+ "no_participation": "# %s no jugó clasificación en la temporada %s\n\nEl jugador no participó en esta temporada o no completó su calibración.",
+ "no_ongoing_season": "# No hay temporada en curso\n\nActualmente no hay ninguna temporada de clasificación.",
"deleted_player": "%s eliminado",
- "neighbors": "Vecinos de Clasificación",
+ "neighbors": "Vecinos de clasificación",
"more": "+%s más"
}
},
From 30f6055a6989e41a4d02718bd3b732d592f79e3c 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 20:51:33 -0600
Subject: [PATCH 89/90] New translations en-us.json (Croatian (disambiguation))
---
src/lang/hr.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lang/hr.json b/src/lang/hr.json
index f8a8ac694..cb21a54fe 100644
--- a/src/lang/hr.json
+++ b/src/lang/hr.json
@@ -218,7 +218,7 @@
}
},
"debug": {
- "$": "odklanjanje grešaka",
+ "$": "odklanjanje-grešaka",
"description": "Debug information about the bot",
"body": {
"title": "# Debug\n\n",
From 47abdaed6f8f3ae449cddc77a4d9fcc814e7372c 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 20:56:22 -0600
Subject: [PATCH 90/90] feat: changelogs
---
docs/changelogs/1.16.2.md | 36 +++++++++++++++++++
.../components/Model/components/TankModel.tsx | 2 +-
.../CoreArmorSceneComponent/index.tsx | 2 --
src/core/blitz/applyPitchYawLimits.ts | 2 +-
4 files changed, 38 insertions(+), 4 deletions(-)
create mode 100644 docs/changelogs/1.16.2.md
diff --git a/docs/changelogs/1.16.2.md b/docs/changelogs/1.16.2.md
new file mode 100644
index 000000000..09b4bce4d
--- /dev/null
+++ b/docs/changelogs/1.16.2.md
@@ -0,0 +1,36 @@
+# Blitzkrieg 1.16.2
+
+¡Hola desde el mundo del español!
+
+## Features
+
+- Added translations for Spanish to the bot
+ - Your language will be inferred automatically from your Discord settings
+ - Any untranslated languages and words we forgot to translate will be left in English
+ - If you have your language set to Spanish and see English in any places, please let us know on [the official Discord server](https://discord.gg/nDt7AjGJQH)
+ - All `/about` commands except for `commands` remain in English
+ - Tank names are still in English
+ - The website remains unchanged
+- The title bar (featured as the big text on top of most commands) has now been made more compact
+
+## Changes
+
+- "Tank type" is now called "tank class"
+- Removed `/player-achievements` and `search-tanks`
+ - They will be reintroduced in the future in a far better way
+ - Also removed a `SKLLD` server exclusive `/eligible` command
+ - This will be generalized for all clans in the future
+
+## Fixes
+
+- Fixed the red glowing floor underneath the tank sandbox
+ - This has been replaced with a static image
+- The refresh button is now properly removed when lacking permissions
+- Tank names that start with a number are now properly inferred from command inputs
+
+## Technical Changes
+
+- Command registration is now error tolerant meaning that if a single command fails to initiate, it will be discarded until the next restart
+ - We are currently looking into how we can allow the command to retry registration after a fixed amount of time
+- Due to the implications of the code added which can be very easily exploited by hackers, a single file has been added to the repository as a closed source submodule and will remain closed unless a third party open-source implementation is made public
+- Removed preview commands
diff --git a/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx b/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx
index 84a7ac601..e5253be2e 100644
--- a/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx
+++ b/src/app/tools/tankopedia/[id]/components/Model/components/TankModel.tsx
@@ -10,7 +10,7 @@ import {
ModelTransformEventData,
modelTransformEvent,
} from '../../../../../../../core/blitzkrieg/modelTransform';
-import { normalizeAngleRad } from '../../../../../../../core/math/normalizeAngleRAD';
+import { normalizeAngleRad } from '../../../../../../../core/math/normalizeAngleRad';
import { useAwait } from '../../../../../../../hooks/useAwait';
import { useModel } from '../../../../../../../hooks/useModel';
import { mutateDuel, useDuel } from '../../../../../../../stores/duel';
diff --git a/src/components/Armor/components/CoreArmorSceneComponent/index.tsx b/src/components/Armor/components/CoreArmorSceneComponent/index.tsx
index aa924cb77..c646ee157 100644
--- a/src/components/Armor/components/CoreArmorSceneComponent/index.tsx
+++ b/src/components/Armor/components/CoreArmorSceneComponent/index.tsx
@@ -1,7 +1,6 @@
import { useFrame } from '@react-three/fiber';
import { useEffect } from 'react';
import {
- GLSL3,
MeshBasicMaterial,
Object3D,
ShaderMaterial,
@@ -39,7 +38,6 @@ export function CoreArmorSceneComponent({
thickness,
}: CoreArmorSceneComponentProps) {
const material = new ShaderMaterial({
- glslVersion: GLSL3,
fragmentShader,
vertexShader,
diff --git a/src/core/blitz/applyPitchYawLimits.ts b/src/core/blitz/applyPitchYawLimits.ts
index 06ca4421b..7565ac3bf 100644
--- a/src/core/blitz/applyPitchYawLimits.ts
+++ b/src/core/blitz/applyPitchYawLimits.ts
@@ -1,6 +1,6 @@
import { clamp } from 'lodash';
import { PitchLimits, YawLimits } from '../blitzkrieg/modelDefinitions';
-import { normalizeAngleRad } from '../math/normalizeAngleRAD';
+import { normalizeAngleRad } from '../math/normalizeAngleRad';
export function applyPitchYawLimits(
pitch: number, // rad