From e28ad04cb5ee572011a35ded9cc66b9542421fc0 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Fri, 12 Feb 2021 11:00:55 +0100 Subject: [PATCH] fix(i18n): remove 'help translate' from English (#41066) --- client/src/redux/propTypes.js | 1 + .../src/templates/Challenges/classic/Show.js | 5 +++- .../Challenges/components/Challenge-Title.js | 25 +++++++++++++------ .../Challenges/components/Side-Panel.js | 3 +++ .../__snapshots__/ChallengeTitle.test.js.snap | 6 ----- .../Challenges/projects/backend/Show.js | 3 +++ .../Challenges/projects/frontend/Show.js | 5 +++- client/src/templates/Challenges/video/Show.js | 3 +++ 8 files changed, 35 insertions(+), 16 deletions(-) diff --git a/client/src/redux/propTypes.js b/client/src/redux/propTypes.js index a246d2399d..66317e2ed2 100644 --- a/client/src/redux/propTypes.js +++ b/client/src/redux/propTypes.js @@ -53,6 +53,7 @@ export const ChallengeNode = PropTypes.shape({ tail: PropTypes.arrayOf(PropTypes.string), time: PropTypes.string, title: PropTypes.string, + translationPending: PropTypes.bool, videoUrl: PropTypes.string }); diff --git a/client/src/templates/Challenges/classic/Show.js b/client/src/templates/Challenges/classic/Show.js index d3c975a971..fe5bd39150 100644 --- a/client/src/templates/Challenges/classic/Show.js +++ b/client/src/templates/Challenges/classic/Show.js @@ -209,7 +209,8 @@ class ShowClassic extends Component { fields: { blockName }, description, instructions, - superBlock + superBlock, + translationPending } = this.getChallenge(); const { forumTopicId, title } = this.getChallenge(); @@ -224,6 +225,7 @@ class ShowClassic extends Component { showToolPanel={showToolPanel} superBlock={superBlock} title={title} + translationPending={translationPending} videoUrl={this.getVideoUrl()} /> ); @@ -362,6 +364,7 @@ export const query = graphql` helpCategory videoUrl superBlock + translationPending forumTopicId fields { slug diff --git a/client/src/templates/Challenges/components/Challenge-Title.js b/client/src/templates/Challenges/components/Challenge-Title.js index 06db39bc0c..9922f159f1 100644 --- a/client/src/templates/Challenges/components/Challenge-Title.js +++ b/client/src/templates/Challenges/components/Challenge-Title.js @@ -11,18 +11,27 @@ const propTypes = { block: PropTypes.string, children: PropTypes.string, isCompleted: PropTypes.bool, - superBlock: PropTypes.string + superBlock: PropTypes.string, + translationPending: PropTypes.bool.isRequired }; -function ChallengeTitle({ block, children, isCompleted, superBlock }) { +function ChallengeTitle({ + block, + children, + isCompleted, + superBlock, + translationPending +}) { return (
- - {i18next.t('misc.translation-pending')} - + {translationPending && ( + + {i18next.t('misc.translation-pending')} + + )}
{title} diff --git a/client/src/templates/Challenges/components/__snapshots__/ChallengeTitle.test.js.snap b/client/src/templates/Challenges/components/__snapshots__/ChallengeTitle.test.js.snap index b2baacd3ed..739fdf0dfb 100644 --- a/client/src/templates/Challenges/components/__snapshots__/ChallengeTitle.test.js.snap +++ b/client/src/templates/Challenges/components/__snapshots__/ChallengeTitle.test.js.snap @@ -4,12 +4,6 @@ exports[` renders correctly 1`] = `
-
diff --git a/client/src/templates/Challenges/projects/backend/Show.js b/client/src/templates/Challenges/projects/backend/Show.js index d839d7fc18..c587e2e440 100644 --- a/client/src/templates/Challenges/projects/backend/Show.js +++ b/client/src/templates/Challenges/projects/backend/Show.js @@ -167,6 +167,7 @@ export class BackEnd extends Component { title, description, instructions, + translationPending, superBlock } }, @@ -200,6 +201,7 @@ export class BackEnd extends Component { block={blockName} isCompleted={isChallengeCompleted} superBlock={superBlock} + translationPending={translationPending} > {title} @@ -258,6 +260,7 @@ export const query = graphql` challengeType helpCategory superBlock + translationPending fields { blockName slug diff --git a/client/src/templates/Challenges/projects/frontend/Show.js b/client/src/templates/Challenges/projects/frontend/Show.js index 3bd217401d..496b6e338f 100644 --- a/client/src/templates/Challenges/projects/frontend/Show.js +++ b/client/src/templates/Challenges/projects/frontend/Show.js @@ -126,7 +126,8 @@ export class Project extends Component { forumTopicId, title, description, - superBlock + superBlock, + translationPending } }, isChallengeCompleted, @@ -157,6 +158,7 @@ export class Project extends Component { block={blockName} isCompleted={isChallengeCompleted} superBlock={superBlock} + translationPending={translationPending} > {title} @@ -200,6 +202,7 @@ export const query = graphql` challengeType helpCategory superBlock + translationPending fields { blockName slug diff --git a/client/src/templates/Challenges/video/Show.js b/client/src/templates/Challenges/video/Show.js index 7be45767b1..856fb253c9 100644 --- a/client/src/templates/Challenges/video/Show.js +++ b/client/src/templates/Challenges/video/Show.js @@ -63,6 +63,7 @@ const propTypes = { challengeMeta: PropTypes.object }), t: PropTypes.func.isRequired, + translationPending: PropTypes.bool.isRequired, updateChallengeMeta: PropTypes.func.isRequired, updateSolutionFormValues: PropTypes.func.isRequired }; @@ -161,6 +162,7 @@ export class Project extends Component { title, description, superBlock, + translationPending, videoId, question: { text, answers, solution } } @@ -194,6 +196,7 @@ export class Project extends Component { block={blockName} isCompleted={isChallengeCompleted} superBlock={superBlock} + translationPending={translationPending} > {title}