mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(client): use translated string for 'Certification' in timeline (#49663)
fix(client): use translation for 'Certification' in timeline
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user