Skip to content

Commit 8967522

Browse files
feat(client): decouple superblock id from certification name (freeCodeCamp#59478)
1 parent 8ac5560 commit 8967522

File tree

7 files changed

+26
-60
lines changed

7 files changed

+26
-60
lines changed

Diff for: client/i18n/locales/english/intro.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@
13351335
}
13361336
},
13371337
"foundational-c-sharp-with-microsoft": {
1338-
"title": "Free Foundational C# with Microsoft",
1338+
"title": "Free Foundational C# with Microsoft Certification",
13391339
"intro": [
13401340
"This course offers a comprehensive introduction to C# programming, covering its core concepts, syntax, and practical application in software development.",
13411341
"Through hands-on exercises and projects, you will learn the fundamentals of C#, including variables, data types, control structures, and object-oriented programming principles.",
@@ -1388,7 +1388,7 @@
13881388
}
13891389
},
13901390
"a2-english-for-developers": {
1391-
"title": "A2 English for Developers (Beta)",
1391+
"title": "A2 English for Developers (Beta) Certification",
13921392
"intro": [
13931393
"In this English for Developers Curriculum, you'll learn the essentials of English communication. This will follow the A2 level of the Common European Framework of Reference (CEFR). And we've focused on vocabulary that is particularly useful for developers.",
13941394
"The first half of the curriculum will help you get comfortable with English grammar and usage. It will give you tons of hands-on practice. You'll learn basics like introducing yourself, making small talk, and discussing your work.",
@@ -1567,7 +1567,7 @@
15671567
}
15681568
},
15691569
"b1-english-for-developers": {
1570-
"title": "B1 English for Developers (Beta)",
1570+
"title": "B1 English for Developers (Beta) Certification",
15711571
"intro": [
15721572
"In this English for Developers Curriculum, you'll learn the essentials of English communication. This will follow the B1 level of the Common European Framework of Reference (CEFR). And we've focused on vocabulary that is particularly useful for developers.",
15731573
"It will help you strengthen your foundational skills while introducing more complex grammar and usage. You'll learn how to describe places and things, share past experiences, and confidently use tenses like Present Perfect and Future. Practical communication strategies are included as well, such as managing conversations, expressing opinions, and building agreement or disagreement in discussions.",
@@ -3799,7 +3799,6 @@
37993799
}
38003800
},
38013801
"misc-text": {
3802-
"certification": "{{cert}} Certification",
38033802
"browse-other": "Browse our other free certifications",
38043803
"courses": "Courses",
38053804
"steps": "Steps",

Diff for: client/i18n/locales/english/translations.json

-3
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,6 @@
456456
"sign-in-see-benefits": "Sign in to see your supporter benefits",
457457
"card-has-been-updated": "Your card has been updated successfully.",
458458
"contact-support-mistake": "If you think there has been a mistake, please contact us at donors@freecodecamp.org",
459-
"cert-map-estimates": {
460-
"certs": "{{title}} Certification"
461-
},
462459
"editor-tabs": {
463460
"code": "Code",
464461
"tests": "Tests",

Diff for: client/src/components/Map/index.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import React, { Fragment } from 'react';
2-
import { useTranslation } from 'react-i18next';
1+
import i18next from 'i18next';
32
import { connect } from 'react-redux';
4-
import { createSelector } from 'reselect';
3+
import React, { Fragment } from 'react';
54
import { Spacer } from '@freecodecamp/ui';
5+
import { createSelector } from 'reselect';
6+
import { useTranslation } from 'react-i18next';
67
import { graphql, useStaticQuery } from 'gatsby';
78

89
import {
@@ -14,7 +15,6 @@ import {
1415
import { SuperBlockIcon } from '../../assets/superblock-icon';
1516
import LinkButton from '../../assets/icons/link-button';
1617
import { ButtonLink } from '../helpers';
17-
import { getSuperBlockTitleForMap } from '../../utils/superblock-map-titles';
1818
import { showUpcomingChanges } from '../../../config/env.json';
1919

2020
import './map.css';
@@ -97,6 +97,8 @@ function MapLi({
9797
showNumbers?: boolean;
9898
index: number;
9999
}) {
100+
const i18nTitle = i18next.t(`intro:${superBlock}.title`);
101+
100102
return (
101103
<li
102104
data-test-label='curriculum-map-button'
@@ -123,7 +125,7 @@ function MapLi({
123125
>
124126
<div style={linkSpacingStyle}>
125127
<SuperBlockIcon className='map-icon' superBlock={superBlock} />
126-
{getSuperBlockTitleForMap(superBlock)}
128+
{i18nTitle}
127129
</div>
128130
{landing && <LinkButton />}
129131
</ButtonLink>

Diff for: client/src/templates/Introduction/super-block-intro.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import i18next from 'i18next';
12
import { WindowLocation } from '@gatsbyjs/reach-router';
23
import { graphql } from 'gatsby';
34
import { uniq, isEmpty, last } from 'lodash-es';
@@ -11,7 +12,6 @@ import { createSelector } from 'reselect';
1112
import { Container, Col, Row, Spacer } from '@freecodecamp/ui';
1213

1314
import { SuperBlocks } from '../../../../shared/config/curriculum';
14-
import { getSuperBlockTitleForMap } from '../../utils/superblock-map-titles';
1515
import DonateModal from '../../components/Donation/donation-modal';
1616
import Login from '../../components/Header/components/login';
1717
import Map from '../../components/Map';
@@ -166,7 +166,7 @@ const SuperBlockIntroductionPage = (props: SuperBlockProps) => {
166166
[superBlockChallenges, allCompletedChallenges]
167167
);
168168

169-
const i18nTitle = getSuperBlockTitleForMap(superBlock);
169+
const i18nTitle = i18next.t(`intro:${superBlock}.title`);
170170

171171
const showCertification = liveCerts.some(
172172
cert => superBlockToCertMap[superBlock] === cert.certSlug

Diff for: client/src/utils/superblock-map-titles.ts

-30
This file was deleted.

Diff for: e2e/intro-page-rwd.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ test.describe('Certification intro page', () => {
2020

2121
await page.goto('/learn/2022/responsive-web-design');
2222

23-
await expect(page).toHaveTitle(
24-
'Responsive Web Design Certification | freeCodeCamp.org'
25-
);
23+
await expect(page).toHaveTitle('Responsive Web Design | freeCodeCamp.org');
2624
await expect(superBlockText).toBeVisible();
2725
await expect(firstBlockText).toBeVisible();
2826
await expect(secondBlockText).not.toBeVisible();

Diff for: e2e/map.spec.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,39 @@ test.beforeEach(async ({ page }) => {
88
const LANDING_PAGE_LINKS = [
99
{
1010
slug: '2022/responsive-web-design',
11-
name: 'Responsive Web Design Certification'
11+
name: 'Responsive Web Design'
1212
},
1313
{
1414
slug: 'javascript-algorithms-and-data-structures-v8',
15-
name: 'JavaScript Algorithms and Data Structures Certification'
15+
name: 'JavaScript Algorithms and Data Structures'
1616
},
1717
{
1818
slug: 'front-end-development-libraries',
19-
name: 'Front End Development Libraries Certification'
19+
name: 'Front End Development Libraries'
2020
},
21-
{ slug: 'data-visualization', name: 'Data Visualization Certification' },
22-
{ slug: 'relational-database', name: 'Relational Database Certification' },
21+
{ slug: 'data-visualization', name: 'Data Visualization' },
22+
{ slug: 'relational-database', name: 'Relational Database' },
2323
{
2424
slug: 'back-end-development-and-apis',
25-
name: 'Back End Development and APIs Certification'
25+
name: 'Back End Development and APIs'
2626
},
27-
{ slug: 'quality-assurance', name: 'Quality Assurance Certification' },
27+
{ slug: 'quality-assurance', name: 'Quality Assurance' },
2828
{
2929
slug: 'scientific-computing-with-python',
30-
name: 'Scientific Computing with Python Certification'
30+
name: 'Scientific Computing with Python'
3131
},
3232
{
3333
slug: 'data-analysis-with-python',
34-
name: 'Data Analysis with Python Certification'
34+
name: 'Data Analysis with Python'
3535
},
36-
{ slug: 'information-security', name: 'Information Security Certification' },
36+
{ slug: 'information-security', name: 'Information Security' },
3737
{
3838
slug: 'machine-learning-with-python',
39-
name: 'Machine Learning with Python Certification'
39+
name: 'Machine Learning with Python'
4040
},
4141
{
4242
slug: 'college-algebra-with-python',
43-
name: 'College Algebra with Python Certification'
43+
name: 'College Algebra with Python'
4444
},
4545
{
4646
slug: 'full-stack-developer',
@@ -68,7 +68,7 @@ const LANDING_PAGE_LINKS = [
6868
},
6969
{
7070
slug: 'javascript-algorithms-and-data-structures',
71-
name: 'Legacy JavaScript Algorithms and Data Structures Certification'
71+
name: 'Legacy JavaScript Algorithms and Data Structures'
7272
},
7373
{ slug: 'python-for-everybody', name: 'Legacy Python for Everybody' }
7474
];

0 commit comments

Comments
 (0)