From d3f089474f85929719d32b57f59951b78b206927 Mon Sep 17 00:00:00 2001 From: sidemt <25644062+sidemt@users.noreply.github.com> Date: Tue, 14 Mar 2023 03:59:25 +0900 Subject: [PATCH] fix(client): use translated string for 'Certification' in timeline (#49663) fix(client): use translation for 'Certification' in timeline --- .../components/profile/components/time-line.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/client/src/components/profile/components/time-line.tsx b/client/src/components/profile/components/time-line.tsx index 38f65146227..c483f02fec8 100644 --- a/client/src/components/profile/components/time-line.tsx +++ b/client/src/components/profile/components/time-line.tsx @@ -8,11 +8,7 @@ import { connect } from 'react-redux'; import envData from '../../../../../config/env.json'; import { getLangCode } from '../../../../../config/i18n'; -import { - getCertIds, - getPathFromID, - getTitleFromId -} from '../../../../../utils'; +import { getCertIds, getPathFromID } from '../../../../../utils'; import { regeneratePathAndHistory } from '../../../../../utils/polyvinyl'; import CertificationIcon from '../../../assets/icons/certification'; import { CompletedChallenge } from '../../../redux/prop-types'; @@ -254,13 +250,11 @@ function useIdToNameMap(t: TFunction): Map { `); const idToNameMap = new Map(); for (const id of getCertIds()) { - const challengeTitle = getTitleFromId(id); + const certPath = getPathFromID(id); + const certName = t(`certification.title.${certPath}`); idToNameMap.set(id, { - challengeTitle: `${t( - `certification.title.${challengeTitle}`, - challengeTitle - )} Certification`, - certPath: getPathFromID(id) + challengeTitle: certName, + certPath: certPath }); } edges.forEach(