summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2019-05-20 13:28:55 +0200
committerAndrej Mihajlov <and@mullvad.net>2019-05-21 12:43:01 +0200
commit5cee6688679b58864b2add36a82492ee578069ee (patch)
treef71844b00e4edb3dff9470315c0120ce6e7ad139
parent273578036b739a514ce2d80b499a7a8e8476f362 (diff)
downloadmullvadvpn-5cee6688679b58864b2add36a82492ee578069ee.tar.xz
mullvadvpn-5cee6688679b58864b2add36a82492ee578069ee.zip
Translate the displayed country and city
-rw-r--r--gui/src/renderer/components/TunnelControl.tsx23
1 files changed, 18 insertions, 5 deletions
diff --git a/gui/src/renderer/components/TunnelControl.tsx b/gui/src/renderer/components/TunnelControl.tsx
index 0a8751e797..ccad62cb51 100644
--- a/gui/src/renderer/components/TunnelControl.tsx
+++ b/gui/src/renderer/components/TunnelControl.tsx
@@ -1,13 +1,12 @@
import * as React from 'react';
import { Component, Styles, Text, Types, View } from 'reactxp';
import { colors } from '../../config.json';
-import { messages } from '../../shared/gettext';
+import { RelayProtocol, TunnelStateTransition } from '../../shared/daemon-rpc-types';
+import { cities, countries, messages, relayLocations } from '../../shared/gettext';
import * as AppButton from './AppButton';
import ConnectionInfo from './ConnectionInfo';
import SecuredLabel, { SecuredDisplayStyle } from './SecuredLabel';
-import { RelayProtocol, TunnelStateTransition } from '../../shared/daemon-rpc-types';
-
export interface IRelayInAddress {
ip: string;
port: number;
@@ -82,8 +81,22 @@ export default class TunnelControl extends Component<ITunnelControlProps> {
const Location = ({ children }: { children?: React.ReactNode }) => (
<View style={styles.status_location}>{children}</View>
);
- const City = () => <Text style={styles.status_location_text}>{this.props.city}</Text>;
- const Country = () => <Text style={styles.status_location_text}>{this.props.country}</Text>;
+ const City = () => (
+ <Text style={styles.status_location_text}>
+ {this.props.city
+ ? relayLocations.gettext(this.props.city) ||
+ cities.gettext(this.props.city) ||
+ this.props.city
+ : undefined}
+ </Text>
+ );
+ const Country = () => (
+ <Text style={styles.status_location_text}>
+ {this.props.country
+ ? countries.gettext(this.props.country) || this.props.country
+ : undefined}
+ </Text>
+ );
const SwitchLocation = () => {
return (