feat: user error strings

This commit is contained in:
TrèsAbhi committed 2024-03-09 11:48:35 -06:00
1 parent 265eff98bf
commit 889ae39e3b
14 files changed
+71 -374

No files matched your search

+2 -2
View File
@@ -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[] = [];
+4 -2
View File
@@ -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<CommandRegistry>(
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),
+7 -1
View File
@@ -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,
+1 -1
View File
@@ -37,7 +37,7 @@ export const ownedTanksCommand = new Promise<CommandRegistry>((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) => ({
+7 -1
View File
@@ -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);