From 970d5b68a4a4d42f3a4eff41a28b034440c1870c Mon Sep 17 00:00:00 2001 From: meriadec Date: Thu, 19 Jul 2018 15:15:43 +0200 Subject: [PATCH] Remove some wordings duplicates closes #1119 --- scripts/check-wordings.js | 36 ++++++++++++++++--- .../Onboarding/steps/GenuineCheck/index.js | 6 +--- src/components/Onboarding/steps/Init.js | 2 +- src/components/RenderError.js | 2 +- src/components/SettingsPage/CleanButton.js | 2 +- src/components/SettingsPage/PasswordModal.js | 4 +-- src/components/SettingsPage/ResetButton.js | 2 +- .../modals/AccountSettingRenderBody.js | 2 +- .../Receive/steps/03-step-confirm-address.js | 2 +- .../modals/UpdateFirmware/Disclaimer.js | 2 +- src/components/modals/UpdateFirmware/index.js | 2 +- src/reducers/onboarding.js | 2 +- static/i18n/en/app.json | 14 ++------ static/i18n/en/onboarding.json | 9 ++--- static/i18n/fr/app.json | 14 ++------ static/i18n/fr/onboarding.json | 9 ++--- 16 files changed, 53 insertions(+), 57 deletions(-) diff --git a/scripts/check-wordings.js b/scripts/check-wordings.js index 0e8e4d0b..e1f301cb 100644 --- a/scripts/check-wordings.js +++ b/scripts/check-wordings.js @@ -39,10 +39,23 @@ const WORDINGS = { } async function main() { + console.log(`>> Checking for unused wordings...`) for (const ns in WORDINGS) { if (WORDINGS.hasOwnProperty(ns)) { try { - await cleanNamespace(ns) + const root = WORDINGS[ns] + await checkForUsage(root, ns, ':') + } catch (err) { + console.log(err) + } + } + } + console.log(`>> Checking for duplicates...`) + for (const ns in WORDINGS) { + if (WORDINGS.hasOwnProperty(ns)) { + try { + const root = WORDINGS[ns] + checkForDuplicate(root, ns, {}, ':') } catch (err) { console.log(err) } @@ -50,9 +63,24 @@ async function main() { } } -async function cleanNamespace(ns) { - const root = WORDINGS[ns] - await checkForUsage(root, ns, ':') +function checkForDuplicate(v, key, values, delimiter = '.') { + if (typeof v === 'object') { + for (const k in v) { + if (v.hasOwnProperty(k)) { + checkForDuplicate(v[k], `${key}${delimiter}${k}`, values) + } + } + } else if (typeof v === 'string') { + if (values[v]) { + console.log(`duplicate value [${v}] for key ${key} (exists in [${values[v].join(', ')}])`) + values[v].push(key) + } else { + values[v] = [key] + } + } else { + console.log(v) + throw new Error('invalid input') + } } async function checkForUsage(v, key, delimiter = '.') { diff --git a/src/components/Onboarding/steps/GenuineCheck/index.js b/src/components/Onboarding/steps/GenuineCheck/index.js index ae472f9c..1214d6db 100644 --- a/src/components/Onboarding/steps/GenuineCheck/index.js +++ b/src/components/Onboarding/steps/GenuineCheck/index.js @@ -185,11 +185,7 @@ class GenuineCheck extends PureComponent { {onboarding.flowType === 'restoreDevice' ? ( {t('onboarding:genuineCheck.descRestore')} ) : ( - - {onboarding.isLedgerNano - ? t('onboarding:genuineCheck.descNano') - : t('onboarding:genuineCheck.descBlue')} - + {t('onboarding:genuineCheck.descGeneric')} )} diff --git a/src/components/Onboarding/steps/Init.js b/src/components/Onboarding/steps/Init.js index 581fa16e..9469c16e 100644 --- a/src/components/Onboarding/steps/Init.js +++ b/src/components/Onboarding/steps/Init.js @@ -56,7 +56,7 @@ class Init extends PureComponent { { key: 'noDevice', icon: , - title: t('onboarding:init.noDevice.title'), + title: t('onboarding:noDevice.title'), onClick: () => { jumpStep('noDevice') flowType('noDevice') diff --git a/src/components/RenderError.js b/src/components/RenderError.js index e20a7f9e..a29c1e7d 100644 --- a/src/components/RenderError.js +++ b/src/components/RenderError.js @@ -103,7 +103,7 @@ class RenderError extends PureComponent< {t('app:crash.github')} { onReject={this.close} onConfirm={this.action} title={t('app:settings.softResetModal.title')} - subTitle={t('app:settings.softResetModal.subTitle')} + subTitle={t('app:common.areYouSure')} desc={t('app:settings.softResetModal.desc')} /> diff --git a/src/components/SettingsPage/PasswordModal.js b/src/components/SettingsPage/PasswordModal.js index 3daed750..e876546e 100644 --- a/src/components/SettingsPage/PasswordModal.js +++ b/src/components/SettingsPage/PasswordModal.js @@ -97,9 +97,7 @@ class PasswordModal extends PureComponent { : t('app:password.setPassword.subTitle')} - {isPasswordEnabled - ? t('app:password.changePassword.desc') - : t('app:password.setPassword.desc')} + {t('app:password.setPassword.desc')} { return ( { onReject={this.handleCloseRemoveAccountModal} onConfirm={() => this.handleRemoveAccount(account)} title={t('app:settings.removeAccountModal.title')} - subTitle={t('app:settings.removeAccountModal.subTitle')} + subTitle={t('app:common.areYouSure')} desc={t('app:settings.removeAccountModal.desc')} /> diff --git a/src/components/modals/Receive/steps/03-step-confirm-address.js b/src/components/modals/Receive/steps/03-step-confirm-address.js index 4e496999..b97cd752 100644 --- a/src/components/modals/Receive/steps/03-step-confirm-address.js +++ b/src/components/modals/Receive/steps/03-step-confirm-address.js @@ -37,7 +37,7 @@ export default class StepConfirmAddress extends PureComponent { {t('app:receive.steps.confirmAddress.text', { currencyName: account.currency.name })} diff --git a/src/components/modals/UpdateFirmware/Disclaimer.js b/src/components/modals/UpdateFirmware/Disclaimer.js index 7871295b..513acff3 100644 --- a/src/components/modals/UpdateFirmware/Disclaimer.js +++ b/src/components/modals/UpdateFirmware/Disclaimer.js @@ -69,7 +69,7 @@ class DisclaimerModal extends PureComponent { diff --git a/src/components/modals/UpdateFirmware/index.js b/src/components/modals/UpdateFirmware/index.js index 5d085176..bde990fa 100644 --- a/src/components/modals/UpdateFirmware/index.js +++ b/src/components/modals/UpdateFirmware/index.js @@ -20,7 +20,7 @@ import StepConfirmation, { StepConfirmFooter } from './steps/03-step-confirmatio const createSteps = ({ t, shouldFlashMcu }: { t: T, shouldFlashMcu: boolean }): Array<*> => { const updateStep = { id: 'idCheck', - label: t('app:manager.modal.steps.idCheck'), + label: t('app:manager.modal.identifier'), component: StepFullFirmwareInstall, footer: null, onBack: null, diff --git a/src/reducers/onboarding.js b/src/reducers/onboarding.js index 44fc65d0..cfc768c2 100644 --- a/src/reducers/onboarding.js +++ b/src/reducers/onboarding.js @@ -93,7 +93,7 @@ const initialState: OnboardingState = { }, { name: 'genuineCheck', - label: 'onboarding:breadcrumb.genuineCheck', + label: 'onboarding:genuineCheck.title', options: { showBreadcrumb: true, }, diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 39825aae..fceda6ae 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -11,6 +11,7 @@ "learnMore": "Learn more", "skipThisStep": "Skip this step", "needHelp": "Need help?", + "areYouSure": "Are you sure?", "selectAccount": "Select an account", "selectAccountNoOption": "No account matching \"{{accountName}}\"", "selectCurrency": "Choose a crypto asset", @@ -53,9 +54,6 @@ "ago": "Synced {{time}}" } }, - "buttons": { - "displayAddressOnDevice": "Verify" - }, "operation": { "type": { "IN": "Received", @@ -240,7 +238,6 @@ "titleNano": "Ledger Nano S", "titleBlue": "Ledger Blue", "update": "Update", - "continue": "Continue", "latest": "Firmware version {{version}} is available", "disclaimerTitle": "You are about to install <1><0>firmware version {{version}}", "disclaimerAppDelete": "Apps installed on your device have to be re-installed after the update.", @@ -248,7 +245,6 @@ }, "modal": { "steps": { - "idCheck": "Identifier", "updateMCU": "MCU update" }, "installing": "Firmware updating...", @@ -401,12 +397,10 @@ }, "softResetModal": { "title": "Clear cache", - "subTitle": "Are you sure?", "desc": "Clearing the Ledger Live cache forces network resynchronization" }, "removeAccountModal": { "title": "Remove account", - "subTitle": "Are you sure?", "desc": "The account will no longer be included in your portfolio. This operation does not affect your assets. Accounts can always be re-added." }, "openUserDataDirectory": { @@ -434,8 +428,7 @@ }, "changePassword": { "title": "Password lock", - "subTitle": "Change your password", - "desc": "Make sure to remember your password. Losing your password requires resetting Ledger Live and re-adding accounts." + "subTitle": "Change your password" }, "setPassword": { "title": "Enable password lock", @@ -455,7 +448,6 @@ "oops": "Oops, something went wrong", "uselessText": "You may try again by restarting Ledger Live. Please export your logs and contact Ledger Support if the problem persists.", "restart": "Restart", - "reset": "Reset", "support": "Contact Support", "github": "GitHub" }, @@ -465,4 +457,4 @@ "desc_2": "Please beware that Ledger does not provide financial, tax, or legal advice. You should take such decisions on your own or consult with reliable experts.", "cta": "Got it" } -} \ No newline at end of file +} diff --git a/static/i18n/en/onboarding.json b/static/i18n/en/onboarding.json index d196a5a6..cc970963 100644 --- a/static/i18n/en/onboarding.json +++ b/static/i18n/en/onboarding.json @@ -3,7 +3,6 @@ "selectDevice": "Device selection", "selectPIN": "PIN code", "writeSeed": "Recovery phrase", - "genuineCheck": "Security checklist", "setPassword": "Password lock", "analytics": "Bugs & analytics" }, @@ -21,9 +20,6 @@ }, "initializedDevice": { "title": "Use a device that's already initialized" - }, - "noDevice": { - "title": "Do not have a Ledger device yet?" } }, "noDevice": { @@ -125,8 +121,7 @@ }, "genuineCheck": { "title": "Security checklist", - "descNano": "Before continuing, please complete the security checklist", - "descBlue": "Before continuing, please complete the security checklist", + "descGeneric": "Before continuing, please complete the security checklist", "descRestore": "Before getting started, please confirm", "step1": { "title": "Did you choose your PIN code by yourself?" @@ -206,4 +201,4 @@ "desc": "Proceed to your portfolio and start adding your accounts...", "openAppButton": "Open Ledger Live" } -} \ No newline at end of file +} diff --git a/static/i18n/fr/app.json b/static/i18n/fr/app.json index 39825aae..fceda6ae 100644 --- a/static/i18n/fr/app.json +++ b/static/i18n/fr/app.json @@ -11,6 +11,7 @@ "learnMore": "Learn more", "skipThisStep": "Skip this step", "needHelp": "Need help?", + "areYouSure": "Are you sure?", "selectAccount": "Select an account", "selectAccountNoOption": "No account matching \"{{accountName}}\"", "selectCurrency": "Choose a crypto asset", @@ -53,9 +54,6 @@ "ago": "Synced {{time}}" } }, - "buttons": { - "displayAddressOnDevice": "Verify" - }, "operation": { "type": { "IN": "Received", @@ -240,7 +238,6 @@ "titleNano": "Ledger Nano S", "titleBlue": "Ledger Blue", "update": "Update", - "continue": "Continue", "latest": "Firmware version {{version}} is available", "disclaimerTitle": "You are about to install <1><0>firmware version {{version}}", "disclaimerAppDelete": "Apps installed on your device have to be re-installed after the update.", @@ -248,7 +245,6 @@ }, "modal": { "steps": { - "idCheck": "Identifier", "updateMCU": "MCU update" }, "installing": "Firmware updating...", @@ -401,12 +397,10 @@ }, "softResetModal": { "title": "Clear cache", - "subTitle": "Are you sure?", "desc": "Clearing the Ledger Live cache forces network resynchronization" }, "removeAccountModal": { "title": "Remove account", - "subTitle": "Are you sure?", "desc": "The account will no longer be included in your portfolio. This operation does not affect your assets. Accounts can always be re-added." }, "openUserDataDirectory": { @@ -434,8 +428,7 @@ }, "changePassword": { "title": "Password lock", - "subTitle": "Change your password", - "desc": "Make sure to remember your password. Losing your password requires resetting Ledger Live and re-adding accounts." + "subTitle": "Change your password" }, "setPassword": { "title": "Enable password lock", @@ -455,7 +448,6 @@ "oops": "Oops, something went wrong", "uselessText": "You may try again by restarting Ledger Live. Please export your logs and contact Ledger Support if the problem persists.", "restart": "Restart", - "reset": "Reset", "support": "Contact Support", "github": "GitHub" }, @@ -465,4 +457,4 @@ "desc_2": "Please beware that Ledger does not provide financial, tax, or legal advice. You should take such decisions on your own or consult with reliable experts.", "cta": "Got it" } -} \ No newline at end of file +} diff --git a/static/i18n/fr/onboarding.json b/static/i18n/fr/onboarding.json index d196a5a6..cc970963 100644 --- a/static/i18n/fr/onboarding.json +++ b/static/i18n/fr/onboarding.json @@ -3,7 +3,6 @@ "selectDevice": "Device selection", "selectPIN": "PIN code", "writeSeed": "Recovery phrase", - "genuineCheck": "Security checklist", "setPassword": "Password lock", "analytics": "Bugs & analytics" }, @@ -21,9 +20,6 @@ }, "initializedDevice": { "title": "Use a device that's already initialized" - }, - "noDevice": { - "title": "Do not have a Ledger device yet?" } }, "noDevice": { @@ -125,8 +121,7 @@ }, "genuineCheck": { "title": "Security checklist", - "descNano": "Before continuing, please complete the security checklist", - "descBlue": "Before continuing, please complete the security checklist", + "descGeneric": "Before continuing, please complete the security checklist", "descRestore": "Before getting started, please confirm", "step1": { "title": "Did you choose your PIN code by yourself?" @@ -206,4 +201,4 @@ "desc": "Proceed to your portfolio and start adding your accounts...", "openAppButton": "Open Ledger Live" } -} \ No newline at end of file +}