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() {
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 = '.') {

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

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

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

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

2
src/components/RenderError.js

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

2
src/components/SettingsPage/CleanButton.js

@ -57,7 +57,7 @@ class CleanButton extends PureComponent<Props, State> {
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')}
/>
</Fragment>

4
src/components/SettingsPage/PasswordModal.js

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

2
src/components/SettingsPage/ResetButton.js

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

2
src/components/modals/AccountSettingRenderBody.js

@ -310,7 +310,7 @@ class HelperComp extends PureComponent<Props, State> {
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')}
/>
</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 })}
</Text>
<Button mt={4} mb={2} primary onClick={() => transitionTo('receive')}>
{t('app:buttons.displayAddressOnDevice')}
{t('app:common.verify')}
</Button>
<DeviceConfirm withoutPushDisplay error={isAddressVerified === false} />
</Fragment>

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

@ -69,7 +69,7 @@ class DisclaimerModal extends PureComponent<Props, State> {
</ModalContent>
<ModalFooter horizontal justifyContent="flex-end" style={{ width: '100%' }}>
<Button primary onClick={goToNextStep}>
{t('app:manager.firmware.continue')}
{t('app:common.continue')}
</Button>
</ModalFooter>
</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 updateStep = {
id: 'idCheck',
label: t('app:manager.modal.steps.idCheck'),
label: t('app:manager.modal.identifier'),
component: StepFullFirmwareInstall,
footer: null,
onBack: null,

2
src/reducers/onboarding.js

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

14
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}}</0></1>",
"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"
}
}
}

9
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"
}
}
}

14
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}}</0></1>",
"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"
}
}
}

9
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"
}
}
}

Loading…
Cancel
Save