Browse Source

Remove some wordings duplicates

closes #1119
master
meriadec 7 years ago
parent
commit
970d5b68a4
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 36
      scripts/check-wordings.js
  2. 6
      src/components/Onboarding/steps/GenuineCheck/index.js
  3. 2
      src/components/Onboarding/steps/Init.js
  4. 2
      src/components/RenderError.js
  5. 2
      src/components/SettingsPage/CleanButton.js
  6. 4
      src/components/SettingsPage/PasswordModal.js
  7. 2
      src/components/SettingsPage/ResetButton.js
  8. 2
      src/components/modals/AccountSettingRenderBody.js
  9. 2
      src/components/modals/Receive/steps/03-step-confirm-address.js
  10. 2
      src/components/modals/UpdateFirmware/Disclaimer.js
  11. 2
      src/components/modals/UpdateFirmware/index.js
  12. 2
      src/reducers/onboarding.js
  13. 14
      static/i18n/en/app.json
  14. 9
      static/i18n/en/onboarding.json
  15. 14
      static/i18n/fr/app.json
  16. 9
      static/i18n/fr/onboarding.json

36
scripts/check-wordings.js

@ -39,10 +39,23 @@ const WORDINGS = {
} }
async function main() { async function main() {
console.log(`>> Checking for unused wordings...`)
for (const ns in WORDINGS) { for (const ns in WORDINGS) {
if (WORDINGS.hasOwnProperty(ns)) { if (WORDINGS.hasOwnProperty(ns)) {
try { 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) { } catch (err) {
console.log(err) console.log(err)
} }
@ -50,9 +63,24 @@ async function main() {
} }
} }
async function cleanNamespace(ns) { function checkForDuplicate(v, key, values, delimiter = '.') {
const root = WORDINGS[ns] if (typeof v === 'object') {
await checkForUsage(root, ns, ':') 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 = '.') { async function checkForUsage(v, key, delimiter = '.') {

6
src/components/Onboarding/steps/GenuineCheck/index.js

@ -185,11 +185,7 @@ class GenuineCheck extends PureComponent<StepProps, State> {
{onboarding.flowType === 'restoreDevice' ? ( {onboarding.flowType === 'restoreDevice' ? (
<Description>{t('onboarding:genuineCheck.descRestore')}</Description> <Description>{t('onboarding:genuineCheck.descRestore')}</Description>
) : ( ) : (
<Description> <Description>{t('onboarding:genuineCheck.descGeneric')}</Description>
{onboarding.isLedgerNano
? t('onboarding:genuineCheck.descNano')
: t('onboarding:genuineCheck.descBlue')}
</Description>
)} )}
<Box mt={5}> <Box mt={5}>
<GenuineCheckCardWrapper> <GenuineCheckCardWrapper>

2
src/components/Onboarding/steps/Init.js

@ -56,7 +56,7 @@ class Init extends PureComponent<StepProps, *> {
{ {
key: 'noDevice', key: 'noDevice',
icon: <IconExternalLink size={20} />, icon: <IconExternalLink size={20} />,
title: t('onboarding:init.noDevice.title'), title: t('onboarding:noDevice.title'),
onClick: () => { onClick: () => {
jumpStep('noDevice') jumpStep('noDevice')
flowType('noDevice') flowType('noDevice')

2
src/components/RenderError.js

@ -103,7 +103,7 @@ class RenderError extends PureComponent<
{t('app:crash.github')} {t('app:crash.github')}
</Button> </Button>
<Button small danger onClick={this.handleOpenHardResetModal}> <Button small danger onClick={this.handleOpenHardResetModal}>
{t('app:crash.reset')} {t('app:common.reset')}
</Button> </Button>
</Box> </Box>
<ConfirmModal <ConfirmModal

2
src/components/SettingsPage/CleanButton.js

@ -57,7 +57,7 @@ class CleanButton extends PureComponent<Props, State> {
onReject={this.close} onReject={this.close}
onConfirm={this.action} onConfirm={this.action}
title={t('app:settings.softResetModal.title')} title={t('app:settings.softResetModal.title')}
subTitle={t('app:settings.softResetModal.subTitle')} subTitle={t('app:common.areYouSure')}
desc={t('app:settings.softResetModal.desc')} desc={t('app:settings.softResetModal.desc')}
/> />
</Fragment> </Fragment>

4
src/components/SettingsPage/PasswordModal.js

@ -97,9 +97,7 @@ class PasswordModal extends PureComponent<Props, State> {
: t('app:password.setPassword.subTitle')} : t('app:password.setPassword.subTitle')}
</Box> </Box>
<Box ff="Open Sans" color="smoke" fontSize={4} textAlign="center" px={4}> <Box ff="Open Sans" color="smoke" fontSize={4} textAlign="center" px={4}>
{isPasswordEnabled {t('app:password.setPassword.desc')}
? t('app:password.changePassword.desc')
: t('app:password.setPassword.desc')}
</Box> </Box>
<PasswordForm <PasswordForm
onSubmit={this.handleSave} onSubmit={this.handleSave}

2
src/components/SettingsPage/ResetButton.js

@ -45,7 +45,7 @@ class ResetButton extends PureComponent<Props, State> {
return ( return (
<Fragment> <Fragment>
<Button small danger onClick={this.open} event="HardResetIntent"> <Button small danger onClick={this.open} event="HardResetIntent">
{t('app:settings.profile.hardReset')} {t('app:common.reset')}
</Button> </Button>
<ConfirmModal <ConfirmModal

2
src/components/modals/AccountSettingRenderBody.js

@ -310,7 +310,7 @@ class HelperComp extends PureComponent<Props, State> {
onReject={this.handleCloseRemoveAccountModal} onReject={this.handleCloseRemoveAccountModal}
onConfirm={() => this.handleRemoveAccount(account)} onConfirm={() => this.handleRemoveAccount(account)}
title={t('app:settings.removeAccountModal.title')} title={t('app:settings.removeAccountModal.title')}
subTitle={t('app:settings.removeAccountModal.subTitle')} subTitle={t('app:common.areYouSure')}
desc={t('app:settings.removeAccountModal.desc')} desc={t('app:settings.removeAccountModal.desc')}
/> />
</ModalBody> </ModalBody>

2
src/components/modals/Receive/steps/03-step-confirm-address.js

@ -37,7 +37,7 @@ export default class StepConfirmAddress extends PureComponent<StepProps> {
{t('app:receive.steps.confirmAddress.text', { currencyName: account.currency.name })} {t('app:receive.steps.confirmAddress.text', { currencyName: account.currency.name })}
</Text> </Text>
<Button mt={4} mb={2} primary onClick={() => transitionTo('receive')}> <Button mt={4} mb={2} primary onClick={() => transitionTo('receive')}>
{t('app:buttons.displayAddressOnDevice')} {t('app:common.verify')}
</Button> </Button>
<DeviceConfirm withoutPushDisplay error={isAddressVerified === false} /> <DeviceConfirm withoutPushDisplay error={isAddressVerified === false} />
</Fragment> </Fragment>

2
src/components/modals/UpdateFirmware/Disclaimer.js

@ -69,7 +69,7 @@ class DisclaimerModal extends PureComponent<Props, State> {
</ModalContent> </ModalContent>
<ModalFooter horizontal justifyContent="flex-end" style={{ width: '100%' }}> <ModalFooter horizontal justifyContent="flex-end" style={{ width: '100%' }}>
<Button primary onClick={goToNextStep}> <Button primary onClick={goToNextStep}>
{t('app:manager.firmware.continue')} {t('app:common.continue')}
</Button> </Button>
</ModalFooter> </ModalFooter>
</Fragment> </Fragment>

2
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 createSteps = ({ t, shouldFlashMcu }: { t: T, shouldFlashMcu: boolean }): Array<*> => {
const updateStep = { const updateStep = {
id: 'idCheck', id: 'idCheck',
label: t('app:manager.modal.steps.idCheck'), label: t('app:manager.modal.identifier'),
component: StepFullFirmwareInstall, component: StepFullFirmwareInstall,
footer: null, footer: null,
onBack: null, onBack: null,

2
src/reducers/onboarding.js

@ -93,7 +93,7 @@ const initialState: OnboardingState = {
}, },
{ {
name: 'genuineCheck', name: 'genuineCheck',
label: 'onboarding:breadcrumb.genuineCheck', label: 'onboarding:genuineCheck.title',
options: { options: {
showBreadcrumb: true, showBreadcrumb: true,
}, },

14
static/i18n/en/app.json

@ -11,6 +11,7 @@
"learnMore": "Learn more", "learnMore": "Learn more",
"skipThisStep": "Skip this step", "skipThisStep": "Skip this step",
"needHelp": "Need help?", "needHelp": "Need help?",
"areYouSure": "Are you sure?",
"selectAccount": "Select an account", "selectAccount": "Select an account",
"selectAccountNoOption": "No account matching \"{{accountName}}\"", "selectAccountNoOption": "No account matching \"{{accountName}}\"",
"selectCurrency": "Choose a crypto asset", "selectCurrency": "Choose a crypto asset",
@ -53,9 +54,6 @@
"ago": "Synced {{time}}" "ago": "Synced {{time}}"
} }
}, },
"buttons": {
"displayAddressOnDevice": "Verify"
},
"operation": { "operation": {
"type": { "type": {
"IN": "Received", "IN": "Received",
@ -240,7 +238,6 @@
"titleNano": "Ledger Nano S", "titleNano": "Ledger Nano S",
"titleBlue": "Ledger Blue", "titleBlue": "Ledger Blue",
"update": "Update", "update": "Update",
"continue": "Continue",
"latest": "Firmware version {{version}} is available", "latest": "Firmware version {{version}} is available",
"disclaimerTitle": "You are about to install <1><0>firmware version {{version}}</0></1>", "disclaimerTitle": "You are about to install <1><0>firmware version {{version}}</0></1>",
"disclaimerAppDelete": "Apps installed on your device have to be re-installed after the update.", "disclaimerAppDelete": "Apps installed on your device have to be re-installed after the update.",
@ -248,7 +245,6 @@
}, },
"modal": { "modal": {
"steps": { "steps": {
"idCheck": "Identifier",
"updateMCU": "MCU update" "updateMCU": "MCU update"
}, },
"installing": "Firmware updating...", "installing": "Firmware updating...",
@ -401,12 +397,10 @@
}, },
"softResetModal": { "softResetModal": {
"title": "Clear cache", "title": "Clear cache",
"subTitle": "Are you sure?",
"desc": "Clearing the Ledger Live cache forces network resynchronization" "desc": "Clearing the Ledger Live cache forces network resynchronization"
}, },
"removeAccountModal": { "removeAccountModal": {
"title": "Remove account", "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." "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": { "openUserDataDirectory": {
@ -434,8 +428,7 @@
}, },
"changePassword": { "changePassword": {
"title": "Password lock", "title": "Password lock",
"subTitle": "Change your password", "subTitle": "Change your password"
"desc": "Make sure to remember your password. Losing your password requires resetting Ledger Live and re-adding accounts."
}, },
"setPassword": { "setPassword": {
"title": "Enable password lock", "title": "Enable password lock",
@ -455,7 +448,6 @@
"oops": "Oops, something went wrong", "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.", "uselessText": "You may try again by restarting Ledger Live. Please export your logs and contact Ledger Support if the problem persists.",
"restart": "Restart", "restart": "Restart",
"reset": "Reset",
"support": "Contact Support", "support": "Contact Support",
"github": "GitHub" "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.", "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" "cta": "Got it"
} }
} }

9
static/i18n/en/onboarding.json

@ -3,7 +3,6 @@
"selectDevice": "Device selection", "selectDevice": "Device selection",
"selectPIN": "PIN code", "selectPIN": "PIN code",
"writeSeed": "Recovery phrase", "writeSeed": "Recovery phrase",
"genuineCheck": "Security checklist",
"setPassword": "Password lock", "setPassword": "Password lock",
"analytics": "Bugs & analytics" "analytics": "Bugs & analytics"
}, },
@ -21,9 +20,6 @@
}, },
"initializedDevice": { "initializedDevice": {
"title": "Use a device that's already initialized" "title": "Use a device that's already initialized"
},
"noDevice": {
"title": "Do not have a Ledger device yet?"
} }
}, },
"noDevice": { "noDevice": {
@ -125,8 +121,7 @@
}, },
"genuineCheck": { "genuineCheck": {
"title": "Security checklist", "title": "Security checklist",
"descNano": "Before continuing, please complete the security checklist", "descGeneric": "Before continuing, please complete the security checklist",
"descBlue": "Before continuing, please complete the security checklist",
"descRestore": "Before getting started, please confirm", "descRestore": "Before getting started, please confirm",
"step1": { "step1": {
"title": "Did you choose your PIN code by yourself?" "title": "Did you choose your PIN code by yourself?"
@ -206,4 +201,4 @@
"desc": "Proceed to your portfolio and start adding your accounts...", "desc": "Proceed to your portfolio and start adding your accounts...",
"openAppButton": "Open Ledger Live" "openAppButton": "Open Ledger Live"
} }
} }

14
static/i18n/fr/app.json

@ -11,6 +11,7 @@
"learnMore": "Learn more", "learnMore": "Learn more",
"skipThisStep": "Skip this step", "skipThisStep": "Skip this step",
"needHelp": "Need help?", "needHelp": "Need help?",
"areYouSure": "Are you sure?",
"selectAccount": "Select an account", "selectAccount": "Select an account",
"selectAccountNoOption": "No account matching \"{{accountName}}\"", "selectAccountNoOption": "No account matching \"{{accountName}}\"",
"selectCurrency": "Choose a crypto asset", "selectCurrency": "Choose a crypto asset",
@ -53,9 +54,6 @@
"ago": "Synced {{time}}" "ago": "Synced {{time}}"
} }
}, },
"buttons": {
"displayAddressOnDevice": "Verify"
},
"operation": { "operation": {
"type": { "type": {
"IN": "Received", "IN": "Received",
@ -240,7 +238,6 @@
"titleNano": "Ledger Nano S", "titleNano": "Ledger Nano S",
"titleBlue": "Ledger Blue", "titleBlue": "Ledger Blue",
"update": "Update", "update": "Update",
"continue": "Continue",
"latest": "Firmware version {{version}} is available", "latest": "Firmware version {{version}} is available",
"disclaimerTitle": "You are about to install <1><0>firmware version {{version}}</0></1>", "disclaimerTitle": "You are about to install <1><0>firmware version {{version}}</0></1>",
"disclaimerAppDelete": "Apps installed on your device have to be re-installed after the update.", "disclaimerAppDelete": "Apps installed on your device have to be re-installed after the update.",
@ -248,7 +245,6 @@
}, },
"modal": { "modal": {
"steps": { "steps": {
"idCheck": "Identifier",
"updateMCU": "MCU update" "updateMCU": "MCU update"
}, },
"installing": "Firmware updating...", "installing": "Firmware updating...",
@ -401,12 +397,10 @@
}, },
"softResetModal": { "softResetModal": {
"title": "Clear cache", "title": "Clear cache",
"subTitle": "Are you sure?",
"desc": "Clearing the Ledger Live cache forces network resynchronization" "desc": "Clearing the Ledger Live cache forces network resynchronization"
}, },
"removeAccountModal": { "removeAccountModal": {
"title": "Remove account", "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." "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": { "openUserDataDirectory": {
@ -434,8 +428,7 @@
}, },
"changePassword": { "changePassword": {
"title": "Password lock", "title": "Password lock",
"subTitle": "Change your password", "subTitle": "Change your password"
"desc": "Make sure to remember your password. Losing your password requires resetting Ledger Live and re-adding accounts."
}, },
"setPassword": { "setPassword": {
"title": "Enable password lock", "title": "Enable password lock",
@ -455,7 +448,6 @@
"oops": "Oops, something went wrong", "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.", "uselessText": "You may try again by restarting Ledger Live. Please export your logs and contact Ledger Support if the problem persists.",
"restart": "Restart", "restart": "Restart",
"reset": "Reset",
"support": "Contact Support", "support": "Contact Support",
"github": "GitHub" "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.", "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" "cta": "Got it"
} }
} }

9
static/i18n/fr/onboarding.json

@ -3,7 +3,6 @@
"selectDevice": "Device selection", "selectDevice": "Device selection",
"selectPIN": "PIN code", "selectPIN": "PIN code",
"writeSeed": "Recovery phrase", "writeSeed": "Recovery phrase",
"genuineCheck": "Security checklist",
"setPassword": "Password lock", "setPassword": "Password lock",
"analytics": "Bugs & analytics" "analytics": "Bugs & analytics"
}, },
@ -21,9 +20,6 @@
}, },
"initializedDevice": { "initializedDevice": {
"title": "Use a device that's already initialized" "title": "Use a device that's already initialized"
},
"noDevice": {
"title": "Do not have a Ledger device yet?"
} }
}, },
"noDevice": { "noDevice": {
@ -125,8 +121,7 @@
}, },
"genuineCheck": { "genuineCheck": {
"title": "Security checklist", "title": "Security checklist",
"descNano": "Before continuing, please complete the security checklist", "descGeneric": "Before continuing, please complete the security checklist",
"descBlue": "Before continuing, please complete the security checklist",
"descRestore": "Before getting started, please confirm", "descRestore": "Before getting started, please confirm",
"step1": { "step1": {
"title": "Did you choose your PIN code by yourself?" "title": "Did you choose your PIN code by yourself?"
@ -206,4 +201,4 @@
"desc": "Proceed to your portfolio and start adding your accounts...", "desc": "Proceed to your portfolio and start adding your accounts...",
"openAppButton": "Open Ledger Live" "openAppButton": "Open Ledger Live"
} }
} }

Loading…
Cancel
Save