From d7a2ea9a2b28678bf46dfb606187f4bbb7d22453 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Wed, 10 Apr 2019 16:34:13 -0500 Subject: [PATCH] Add Localhost 8545 for network dropdown names --- app/_locales/en/messages.json | 3 +++ ui/app/components/app/dropdowns/network-dropdown.js | 2 ++ .../loading-network-screen.component.js | 2 ++ ui/app/components/app/network.js | 2 +- ui/app/pages/routes/index.js | 4 ++++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 154925d1a216..f9d23f69ede2 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -308,6 +308,9 @@ "connectingToRinkeby": { "message": "Connecting to Rinkeby Test Network" }, + "connectingToLocalhost": { + "message": "Connecting to Localhost 8545" + }, "connectingToUnknown": { "message": "Connecting to Unknown Network" }, diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index 3d9037a06fbb..7e645725cf9d 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -285,6 +285,8 @@ NetworkDropdown.prototype.getNetworkName = function () { name = this.context.t('kovan') } else if (providerName === 'rinkeby') { name = this.context.t('rinkeby') + } else if (providerName === 'localhost') { + name = this.context.t('localhost') } else { name = provider.nickname || this.context.t('unknownNetwork') } diff --git a/ui/app/components/app/loading-network-screen/loading-network-screen.component.js b/ui/app/components/app/loading-network-screen/loading-network-screen.component.js index 348a997c82c1..b79051d0bfbf 100644 --- a/ui/app/components/app/loading-network-screen/loading-network-screen.component.js +++ b/ui/app/components/app/loading-network-screen/loading-network-screen.component.js @@ -45,6 +45,8 @@ export default class LoadingNetworkScreen extends PureComponent { name = this.context.t('connectingToKovan') } else if (providerName === 'rinkeby') { name = this.context.t('connectingToRinkeby') + } else if (providerName === 'localhost') { + name = this.context.t('connectingToLocalhost') } else { name = this.context.t('connectingTo', [providerId]) } diff --git a/ui/app/components/app/network.js b/ui/app/components/app/network.js index e18404f42946..54065dd73e39 100644 --- a/ui/app/components/app/network.js +++ b/ui/app/components/app/network.js @@ -139,7 +139,7 @@ Network.prototype.render = function () { }, }), - h('.network-name', providerNick || context.t('privateNetwork')), + h('.network-name', providerName === 'localhost' ? context.t('localhost') : providerNick || context.t('privateNetwork')), h('i.fa.fa-chevron-down.fa-lg.network-caret'), ]) } diff --git a/ui/app/pages/routes/index.js b/ui/app/pages/routes/index.js index e06d88c90ce5..37ff2df6125b 100644 --- a/ui/app/pages/routes/index.js +++ b/ui/app/pages/routes/index.js @@ -267,6 +267,8 @@ class Routes extends Component { name = this.context.t('connectingToKovan') } else if (providerName === 'rinkeby') { name = this.context.t('connectingToRinkeby') + } else if (providerName === 'localhost') { + name = this.context.t('connectingToLocalhost') } else { name = this.context.t('connectingTo', [providerId]) } @@ -288,6 +290,8 @@ class Routes extends Component { name = this.context.t('kovan') } else if (providerName === 'rinkeby') { name = this.context.t('rinkeby') + } else if (providerName === 'localhost') { + name = this.context.t('localhost') } else { name = this.context.t('unknownNetwork') }