Skip to content

Commit 6c020f7

Browse files
author
Nicholas Carrigan (he/him)
authored
feat(i18n, client): translate breadcrumbs (freeCodeCamp#40881)
1 parent e0e86c4 commit 6c020f7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

client/src/templates/Challenges/components/Challenge-Title.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Link } from '../../../components/helpers/index';
55
import { dasherize } from '../../../../../utils/slugs';
66
import './challenge-title.css';
77
import GreenPass from '../../../assets/icons/GreenPass';
8+
import i18next from 'i18next';
89

910
const propTypes = {
1011
block: PropTypes.string,
@@ -21,15 +22,19 @@ function ChallengeTitle({ block, children, isCompleted, superBlock }) {
2122
className='breadcrumb-left'
2223
to={`/learn/${dasherize(superBlock)}`}
2324
>
24-
<span className='ellipsis'>{superBlock}</span>
25+
<span className='ellipsis'>
26+
{i18next.t(`intro:${dasherize(superBlock)}.title`)}
27+
</span>
2528
</Link>
2629
<div className='breadcrumb-center' />
2730
<Link
2831
className='breadcrumb-right'
2932
state={{ breadcrumbBlockClick: block }}
3033
to={`/learn/${dasherize(superBlock)}`}
3134
>
32-
{block}
35+
{i18next.t(
36+
`intro:${dasherize(superBlock)}.blocks.${dasherize(block)}.title`
37+
)}
3338
</Link>
3439
</div>
3540
<div className='challenge-title'>

0 commit comments

Comments
 (0)