From 5620b118f4e7d9b01ee8ff0cad787de0b7e16333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 6 Mar 2024 17:41:05 -0600 Subject: [PATCH] feat: some full stats locale --- src/commands/fullStats.tsx | 6 +++- src/components/GenericAllStats/index.tsx | 41 +++++++++++++----------- src/lang/en-US.json | 36 +++++++++++++++++++++ 3 files changed, 64 insertions(+), 19 deletions(-) diff --git a/src/commands/fullStats.tsx b/src/commands/fullStats.tsx index 5a3da27a0..9fa3129c4 100644 --- a/src/commands/fullStats.tsx +++ b/src/commands/fullStats.tsx @@ -61,7 +61,11 @@ async function render( )} {stats.battles > 0 && } {stats.battles > 0 && ( - + )} ); diff --git a/src/components/GenericAllStats/index.tsx b/src/components/GenericAllStats/index.tsx index 21cbee368..c315011fc 100644 --- a/src/components/GenericAllStats/index.tsx +++ b/src/components/GenericAllStats/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 isNumber from '../../core/math/isNumber'; import getWN8Percentile from '../../core/statistics/getWN8Percentile'; import { Card } from './components/Card'; @@ -8,12 +10,15 @@ import { Row } from './components/Row'; export interface GenericAllStatsProps { stats: AllStats; supplementaryStats?: SupplementaryStats; + locale: Locale; } export default function GenericAllStats({ stats, supplementaryStats, + locale, }: GenericAllStatsProps) { + const { t } = translator(locale); const damageRatio = stats.damage_dealt / stats.damage_received; const killsToDeathRatio = stats.frags / (stats.battles - stats.survived_battles); @@ -22,27 +27,27 @@ export default function GenericAllStats({