diff --git a/client/src/templates/Challenges/classic/show.tsx b/client/src/templates/Challenges/classic/show.tsx index f1e4fa997e..02c0671a02 100644 --- a/client/src/templates/Challenges/classic/show.tsx +++ b/client/src/templates/Challenges/classic/show.tsx @@ -280,12 +280,9 @@ class ShowClassic extends Component { getChallenge = () => this.props.data.challengeNode; - getBlockNameTitle() { - const { - fields: { blockName }, - title - } = this.getChallenge(); - return `${blockName}: ${title}`; + getBlockNameTitle(t: TFunction) { + const { block, superBlock, title } = this.getChallenge(); + return `${t(`intro:${superBlock}.blocks.${block}.title`)}: ${title}`; } getVideoUrl = () => this.getChallenge().videoUrl; @@ -422,11 +419,7 @@ class ShowClassic extends Component { usesMultifileEditor={usesMultifileEditor} > - + { updateSolutionFormValues } = this.props; - const blockNameTitle = `${blockName} - ${title}`; + const blockNameTitle = `${t( + `intro:${superBlock}.blocks.${block}.title` + )} - ${title}`; return ( { updateSolutionFormValues } = this.props; - const blockNameTitle = `${blockName} - ${title}`; + const blockNameTitle = `${t( + `intro:${superBlock}.blocks.${block}.title` + )} - ${title}`; return ( { isChallengeCompleted } = this.props; - const blockNameTitle = `${blockName} - ${title}`; + const blockNameTitle = `${t( + `intro:${superBlock}.blocks.${block}.title` + )} - ${title}`; return ( { diff --git a/cypress/integration/learn/challenges/backend.js b/cypress/integration/learn/challenges/backend.js index ef908594ea..898475f6e0 100644 --- a/cypress/integration/learn/challenges/backend.js +++ b/cypress/integration/learn/challenges/backend.js @@ -19,7 +19,7 @@ describe('Backend challenge', function () { cy.title().should( 'eq', - 'Managing Packages with Npm - How to Use package.json, the Core of Any' + + 'Managing Packages with NPM - How to Use package.json, the Core of Any' + ' Node.js Project or npm Package | Learn | freeCodeCamp.org' ); }); diff --git a/cypress/integration/learn/challenges/output.js b/cypress/integration/learn/challenges/output.js index 6e8e3b9aa0..25b28fdce4 100644 --- a/cypress/integration/learn/challenges/output.js +++ b/cypress/integration/learn/challenges/output.js @@ -27,8 +27,7 @@ describe('Classic challenge', function () { it('renders the default output text', () => { cy.title().should( 'eq', - 'Learn Basic HTML and HTML5: Say Hello to HTML Elements |' + - ' freeCodeCamp.org' + 'Basic HTML and HTML5: Say Hello to HTML Elements |' + ' freeCodeCamp.org' ); cy.get(selectors.defaultOutput).contains(defaultOutput); }); diff --git a/cypress/integration/legacy/redirects/challenges.js b/cypress/integration/legacy/redirects/challenges.js index b0f6b197f1..7ba760363f 100644 --- a/cypress/integration/legacy/redirects/challenges.js +++ b/cypress/integration/legacy/redirects/challenges.js @@ -43,7 +43,7 @@ describe('challenges/superblock/block/challenge redirect', function () { cy.title().should( 'eq', // eslint-disable-next-line max-len - 'Learn Basic HTML and HTML5: Say Hello to HTML Elements | freeCodeCamp.org' + 'Basic HTML and HTML5: Say Hello to HTML Elements | freeCodeCamp.org' ); cy.location().should(loc => { expect(loc.pathname).to.eq(locations.learnChallenge);