diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index cbc15554c3a..3119bd14f7e 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -413,7 +413,7 @@ "tab-trapped": "Pressing tab will now insert the tab character", "tab-free": "Pressing tab will now move focus to the next focusable element" }, - "help-translate": "We are still translating the following certifications.", + "help-translate": "We are still translating this certification.", "help-translate-link": "Help us translate.", "project-preview-title": "Here's a preview of what you will build", "github-required": "<0>Create a GitHub account if you don't have one. You'll need it when you create the virtual Linux server machine. This process may take a few minutes.", diff --git a/client/src/components/Map/index.tsx b/client/src/components/Map/index.tsx index cb15f6e3527..aea3957d9d9 100644 --- a/client/src/components/Map/index.tsx +++ b/client/src/components/Map/index.tsx @@ -1,22 +1,16 @@ -import i18next from 'i18next'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { SuperBlockStages, SuperBlocks, - getFirstNotAuditedSuperBlock, superBlockOrder } from '../../../../shared/config/superblocks'; import { SuperBlockIcon } from '../../assets/icons/superblock-icon'; import LinkButton from '../../assets/icons/link-button'; import { Link, Spacer } from '../helpers'; import { getSuperBlockTitleForMap } from '../../utils/superblock-map-titles'; -import { - curriculumLocale, - showUpcomingChanges, - showNewCurriculum -} from '../../../config/env.json'; +import { showUpcomingChanges } from '../../../config/env.json'; import './map.css'; @@ -31,12 +25,6 @@ const linkSpacingStyle = { gap: '15px' }; -const firstNotAuditedSuperBlock = getFirstNotAuditedSuperBlock({ - language: curriculumLocale, - showNewCurriculum, - showUpcomingChanges -}); - const coreCurriculum = [ ...superBlockOrder[SuperBlockStages.FrontEnd], ...superBlockOrder[SuperBlockStages.Backend], @@ -52,25 +40,6 @@ function MapLi({ }) { return ( <> - {firstNotAuditedSuperBlock === superBlock && ( - <> -
-
-

- {i18next.t('learn.help-translate')}{' '} -

- - {i18next.t('learn.help-translate-link')} - - -
- - )} -
  • + +

    {t('learn.help-translate')}

    + + {t('learn.help-translate-link')} + + + ); +} + +export default HelpTranslate; diff --git a/client/src/templates/Introduction/super-block-intro.tsx b/client/src/templates/Introduction/super-block-intro.tsx index a4d30e6230e..c056b40b889 100644 --- a/client/src/templates/Introduction/super-block-intro.tsx +++ b/client/src/templates/Introduction/super-block-intro.tsx @@ -29,6 +29,7 @@ import { defaultDonation } from '../../../../shared/config/donation-settings'; import Block from './components/block'; import CertChallenge from './components/cert-challenge'; import LegacyLinks from './components/legacy-links'; +import HelpTranslate from './components/help-translate'; import SuperBlockIntro from './components/super-block-intro'; import { resetExpansion, toggleBlock } from './redux'; @@ -220,6 +221,7 @@ const SuperBlockIntroductionPage = (props: SuperBlockProp) => { } isDonating={user.isDonating} /> +

    {t(`intro:misc-text.courses`)} diff --git a/shared/config/superblocks.test.ts b/shared/config/superblocks.test.ts index 921e810e47e..6dad54f00c7 100644 --- a/shared/config/superblocks.test.ts +++ b/shared/config/superblocks.test.ts @@ -6,8 +6,7 @@ import { notAuditedSuperBlocks, createSuperBlockMap, createFlatSuperBlockMap, - getAuditedSuperBlocks, - getFirstNotAuditedSuperBlock + getAuditedSuperBlocks } from './superblocks'; describe('superBlockOrder', () => { @@ -66,26 +65,6 @@ describe('createFlatSuperBlockMap', () => { }); }); -describe('firstNotAuditedSuperBlock', () => { - it("should return 'null' when language is 'english'", () => { - const result = getFirstNotAuditedSuperBlock({ - language: Languages.English, - showNewCurriculum: false, - showUpcomingChanges: false - }); - expect(result).toBeNull(); - }); - - it.skip("should return a SuperBlock when language is 'chinese'", () => { - const result = getFirstNotAuditedSuperBlock({ - language: Languages.Chinese, - showNewCurriculum: false, - showUpcomingChanges: false - }); - expect(result).toEqual(SuperBlocks.JsAlgoDataStructNew); - }); -}); - describe('Immutability of superBlockOrder, notAuditedSuperBlocks, and flatSuperBlockMap', () => { it('should not allow modification of superBlockOrder', () => { expect(() => { diff --git a/shared/config/superblocks.ts b/shared/config/superblocks.ts index b1ed4b21e3c..7bad9395938 100644 --- a/shared/config/superblocks.ts +++ b/shared/config/superblocks.ts @@ -286,24 +286,6 @@ export function createFlatSuperBlockMap({ return Object.values(superBlockMap).flat(); } -// this is so we know where to display the "help us translate" section -export function getFirstNotAuditedSuperBlock({ - language, - showNewCurriculum, - showUpcomingChanges -}: LanguagesConfig): SuperBlocks | null { - const flatSuperBlockMap = createFlatSuperBlockMap({ - showNewCurriculum, - showUpcomingChanges - }); - for (const superBlock of flatSuperBlockMap) { - if (notAuditedSuperBlocks[language as Languages].includes(superBlock)) { - return superBlock; - } - } - return null; -} - export function getAuditedSuperBlocks({ language = 'english', showNewCurriculum,