diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-12-09 11:35:57 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-12-09 11:35:57 +0100 |
| commit | 9ac3d19874dd7d4cd9396b142e925b0b609b8181 (patch) | |
| tree | df2a94fb8444a1355a00b0f867f9c80517e8b7f1 /gui/src/renderer | |
| parent | 44a8a6efd56abe5f2eec791e4230014b2870508e (diff) | |
| parent | 327f13f19be9e0bfab7af1490aacb5a33951901d (diff) | |
| download | mullvadvpn-9ac3d19874dd7d4cd9396b142e925b0b609b8181.tar.xz mullvadvpn-9ac3d19874dd7d4cd9396b142e925b0b609b8181.zip | |
Merge branch 'disable-translation-error-logs-in-production'
Diffstat (limited to 'gui/src/renderer')
| -rw-r--r-- | gui/src/renderer/app.tsx | 4 | ||||
| -rw-r--r-- | gui/src/renderer/containers/ConnectPage.tsx | 19 |
2 files changed, 10 insertions, 13 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx index 4de7bb8ca6..8b4116d647 100644 --- a/gui/src/renderer/app.tsx +++ b/gui/src/renderer/app.tsx @@ -584,7 +584,7 @@ export default class AppRenderer { const contentHeight = window.innerHeight; if (contentHeight !== expectedContentHeight) { - log.debug( + log.verbose( resize ? 'Resize:' : 'Initial:', `Wrong content height: ${contentHeight}, expected ${expectedContentHeight}`, ); @@ -722,7 +722,7 @@ export default class AppRenderer { private setTunnelState(tunnelState: TunnelState) { const actions = this.reduxActions; - log.debug(`Tunnel state: ${tunnelState.state}`); + log.verbose(`Tunnel state: ${tunnelState.state}`); this.tunnelState = tunnelState; // The main process doesn't notify the tunnel state while waiting for a new one (unless it times diff --git a/gui/src/renderer/containers/ConnectPage.tsx b/gui/src/renderer/containers/ConnectPage.tsx index c9ae60897b..9d507ede18 100644 --- a/gui/src/renderer/containers/ConnectPage.tsx +++ b/gui/src/renderer/containers/ConnectPage.tsx @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import { sprintf } from 'sprintf-js'; -import { messages } from '../../shared/gettext'; +import { messages, relayLocations } from '../../shared/gettext'; import log from '../../shared/logging'; import Connect from '../components/Connect'; import withAppContext, { IAppContext } from '../context'; @@ -9,32 +9,29 @@ import { RoutePath } from '../lib/routes'; import { IRelayLocationRedux, RelaySettingsRedux } from '../redux/settings/reducers'; import { IReduxState, ReduxDispatch } from '../redux/store'; -function getRelayName( - relaySettings: RelaySettingsRedux, - relayLocations: IRelayLocationRedux[], -): string { +function getRelayName(relaySettings: RelaySettingsRedux, locations: IRelayLocationRedux[]): string { if ('normal' in relaySettings) { const location = relaySettings.normal.location; if (location === 'any') { return 'Automatic'; } else if ('country' in location) { - const country = relayLocations.find(({ code }) => code === location.country); + const country = locations.find(({ code }) => code === location.country); if (country) { - return country.name; + return relayLocations.gettext(country.name); } } else if ('city' in location) { const [countryCode, cityCode] = location.city; - const country = relayLocations.find(({ code }) => code === countryCode); + const country = locations.find(({ code }) => code === countryCode); if (country) { const city = country.cities.find(({ code }) => code === cityCode); if (city) { - return city.name; + return relayLocations.gettext(city.name); } } } else if ('hostname' in location) { const [countryCode, cityCode, hostname] = location.hostname; - const country = relayLocations.find(({ code }) => code === countryCode); + const country = locations.find(({ code }) => code === countryCode); if (country) { const city = country.cities.find(({ code }) => code === cityCode); if (city) { @@ -46,7 +43,7 @@ function getRelayName( // TRANSLATORS: %(hostname)s - a hostname messages.pgettext('connect-container', '%(city)s (%(hostname)s)'), { - city: city.name, + city: relayLocations.gettext(city.name), hostname, }, ); |
