fix(client): use translated string for 'Certification' in timeline (#49663)

fix(client): use translation for 'Certification' in timeline
This commit is contained in:
sidemt
2023-03-13 11:59:25 -07:00
committed by GitHub
parent 0811e8ca46
commit d3f089474f
@@ -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<string, NameMap> {
`);
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(