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": { "importAccount": {
"message": "Import Account" "message": "Import Account"
}, },
"importAccountError": {
"message": "Error importing account."
},
"importAccountLinkText": { "importAccountLinkText": {
"message": "import using Secret Recovery Phrase" "message": "import using Secret Recovery Phrase"
}, },

View File

@ -102,9 +102,10 @@ class JsonImportSubview extends Component {
setSelectedAddress, setSelectedAddress,
} = this.props; } = this.props;
const { fileContents } = this.state; const { fileContents } = this.state;
const { t } = this.context;
if (!fileContents) { if (!fileContents) {
const message = this.context.t('needImportFile'); const message = t('needImportFile');
displayWarning(message); displayWarning(message);
return; return;
} }
@ -124,7 +125,7 @@ class JsonImportSubview extends Component {
}); });
displayWarning(null); displayWarning(null);
} else { } else {
displayWarning('Error importing account.'); displayWarning(t('importAccountError'));
this.context.metricsEvent({ this.context.metricsEvent({
eventOpts: { eventOpts: {
category: 'Accounts', category: 'Accounts',

View File

@ -38,6 +38,7 @@ class PrivateKeyImportView extends Component {
setSelectedAddress, setSelectedAddress,
firstAddress, firstAddress,
} = this.props; } = this.props;
const { t } = this.context;
importNewAccount('Private Key', [privateKey]) importNewAccount('Private Key', [privateKey])
.then(({ selectedAddress }) => { .then(({ selectedAddress }) => {
@ -52,7 +53,7 @@ class PrivateKeyImportView extends Component {
history.push(mostRecentOverviewPage); history.push(mostRecentOverviewPage);
displayWarning(null); displayWarning(null);
} else { } else {
displayWarning('Error importing account.'); displayWarning(t('importAccountError'));
this.context.metricsEvent({ this.context.metricsEvent({
eventOpts: { eventOpts: {
category: 'Accounts', category: 'Accounts',