From dc3e74a66a791412f68973469f6dfbd2be16683c Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 25 Aug 2021 09:14:42 -0700 Subject: [PATCH] Localize import account warning messages (#11910) --- app/_locales/en/messages.json | 3 +++ ui/pages/create-account/import-account/json.js | 5 +++-- ui/pages/create-account/import-account/private-key.js | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index b07954fe1..b77de64f1 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1044,6 +1044,9 @@ "importAccount": { "message": "Import Account" }, + "importAccountError": { + "message": "Error importing account." + }, "importAccountLinkText": { "message": "import using Secret Recovery Phrase" }, diff --git a/ui/pages/create-account/import-account/json.js b/ui/pages/create-account/import-account/json.js index afaeb7751..1aa35c493 100644 --- a/ui/pages/create-account/import-account/json.js +++ b/ui/pages/create-account/import-account/json.js @@ -102,9 +102,10 @@ class JsonImportSubview extends Component { setSelectedAddress, } = this.props; const { fileContents } = this.state; + const { t } = this.context; if (!fileContents) { - const message = this.context.t('needImportFile'); + const message = t('needImportFile'); displayWarning(message); return; } @@ -124,7 +125,7 @@ class JsonImportSubview extends Component { }); displayWarning(null); } else { - displayWarning('Error importing account.'); + displayWarning(t('importAccountError')); this.context.metricsEvent({ eventOpts: { category: 'Accounts', diff --git a/ui/pages/create-account/import-account/private-key.js b/ui/pages/create-account/import-account/private-key.js index c360424be..507fb09f6 100644 --- a/ui/pages/create-account/import-account/private-key.js +++ b/ui/pages/create-account/import-account/private-key.js @@ -38,6 +38,7 @@ class PrivateKeyImportView extends Component { setSelectedAddress, firstAddress, } = this.props; + const { t } = this.context; importNewAccount('Private Key', [privateKey]) .then(({ selectedAddress }) => { @@ -52,7 +53,7 @@ class PrivateKeyImportView extends Component { history.push(mostRecentOverviewPage); displayWarning(null); } else { - displayWarning('Error importing account.'); + displayWarning(t('importAccountError')); this.context.metricsEvent({ eventOpts: { category: 'Accounts',