1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Localize import account warning messages (#11910)

This commit is contained in:
ryanml 2021-08-25 09:14:42 -07:00 committed by GitHub
parent 472cf17bda
commit dc3e74a66a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -1044,6 +1044,9 @@
"importAccount": {
"message": "Import Account"
},
"importAccountError": {
"message": "Error importing account."
},
"importAccountLinkText": {
"message": "import using Secret Recovery Phrase"
},

View File

@ -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',

View File

@ -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',