From ac94a0bf221c2fccf8e96a8fcb06a3950bf3d77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20J=C3=B8rgensen?= <28780271+lasjorg@users.noreply.github.com> Date: Tue, 30 Jul 2024 01:08:54 +0200 Subject: [PATCH] fix(client): add key specific names to button translation properties (#55694) --- client/i18n/locales/english/translations.json | 14 +++++++------- .../src/templates/Challenges/classic/lower-jaw.tsx | 10 +++++----- .../Challenges/components/completion-modal.tsx | 8 ++++---- e2e/challenge-reset-modal.spec.ts | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index 86670b1af5f..8588047ee34 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -55,9 +55,9 @@ "reset-lesson": "Reset this lesson", "run": "Run", "run-test": "Run the Tests (Ctrl + Enter)", - "check-code": "Check Your Code (Ctrl + Enter)", - "check-code-2": "Check Your Code", - "check-code-3": "Check Your Code (Command + Enter)", + "check-code": "Check Your Code", + "check-code-ctrl": "Check Your Code (Ctrl + Enter)", + "check-code-cmd": "Check Your Code (Command + Enter)", "reset": "Reset", "reset-step": "Reset This Step", "help": "Help", @@ -72,11 +72,11 @@ "update-email": "Update my Email", "verify-email": "Verify Email", "submit-and-go": "Submit and go to next challenge", - "submit-and-go-2": "Submit and go to next challenge (Ctrl + Enter)", - "submit-and-go-3": "Submit and go to next challenge (Command + Enter)", + "submit-and-go-ctrl": "Submit and go to next challenge (Ctrl + Enter)", + "submit-and-go-cmd": "Submit and go to next challenge (Command + Enter)", "go-to-next": "Go to next challenge", - "go-to-next-2": "Go to next challenge (Ctrl + Enter)", - "go-to-next-3": "Go to next challenge (Command + Enter)", + "go-to-next-ctrl": "Go to next challenge (Ctrl + Enter)", + "go-to-next-cmd": "Go to next challenge (Command + Enter)", "ask-later": "Ask me later", "start-coding": "Start coding!", "go-to-settings": "Go to settings to claim your certification", diff --git a/client/src/templates/Challenges/classic/lower-jaw.tsx b/client/src/templates/Challenges/classic/lower-jaw.tsx index 711b4cdf154..8c265c548ec 100644 --- a/client/src/templates/Challenges/classic/lower-jaw.tsx +++ b/client/src/templates/Challenges/classic/lower-jaw.tsx @@ -289,14 +289,14 @@ const LowerJaw = ({ const checkButtonText = isDesktop ? isMacOS - ? t('buttons.check-code-3') - : t('buttons.check-code') - : t('buttons.check-code-2'); + ? t('buttons.check-code-cmd') + : t('buttons.check-code-ctrl') + : t('buttons.check-code'); const submitButtonText = isDesktop ? isMacOS - ? t('buttons.submit-and-go-3') - : t('buttons.submit-and-go-2') + ? t('buttons.submit-and-go-cmd') + : t('buttons.submit-and-go-ctrl') : t('buttons.submit-and-go'); const showSignInButton = !isSignedIn && challengeIsCompleted; diff --git a/client/src/templates/Challenges/components/completion-modal.tsx b/client/src/templates/Challenges/components/completion-modal.tsx index fc47764ed02..90e4b95aaf1 100644 --- a/client/src/templates/Challenges/components/completion-modal.tsx +++ b/client/src/templates/Challenges/components/completion-modal.tsx @@ -176,12 +176,12 @@ class CompletionModal extends Component< if (isDesktop) { if (isMacOS) { buttonText = isSignedIn - ? t('buttons.submit-and-go-3') - : t('buttons.go-to-next-3'); + ? t('buttons.submit-and-go-cmd') + : t('buttons.go-to-next-cmd'); } else { buttonText = isSignedIn - ? t('buttons.submit-and-go-2') - : t('buttons.go-to-next-2'); + ? t('buttons.submit-and-go-ctrl') + : t('buttons.go-to-next-ctrl'); } } else { buttonText = isSignedIn diff --git a/e2e/challenge-reset-modal.spec.ts b/e2e/challenge-reset-modal.spec.ts index 6da2d66fc0d..ee208a6d65b 100644 --- a/e2e/challenge-reset-modal.spec.ts +++ b/e2e/challenge-reset-modal.spec.ts @@ -72,9 +72,9 @@ test('User can reset challenge', async ({ page, isMobile, browserName }) => { // are reset) await page .getByRole('button', { - // check-code-2 works on all browsers because it does not include Command + // check-code works on all browsers because it does not include Command // or Ctrl - name: translations.buttons['check-code-2'] + name: translations.buttons['check-code'] }) .click();