diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-03-08 13:15:38 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-03-08 13:15:38 -0300 |
commit | 926575bc811e8382100695a3396da7191fb43eb3 (patch) | |
tree | ed5326517f1d1d6952eb5639d82230717c381812 | |
parent | 977bd769b78596346f3c999e6bdb8523dc0929e4 (diff) |
Add translation support
Also:
- Make OpenVPN use a random port every time
- Logout in parallel so the UI doesn't block
- Add the WAIT status from OpenVPN to the mainwindow displays
- Support non-unix sockets in the LinuxVPNLauncher
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | data/leap_client.pro | 27 | ||||
-rw-r--r-- | data/ts/en_US.ts | 434 | ||||
-rw-r--r-- | src/leap/app.py | 3 | ||||
-rw-r--r-- | src/leap/config/baseconfig.py | 11 | ||||
-rw-r--r-- | src/leap/crypto/srpauth.py | 34 | ||||
-rw-r--r-- | src/leap/gui/mainwindow.py | 72 | ||||
-rw-r--r-- | src/leap/gui/ui/wizard.ui | 1 | ||||
-rw-r--r-- | src/leap/gui/wizard.py | 28 | ||||
-rw-r--r-- | src/leap/services/eip/vpn.py | 5 | ||||
-rw-r--r-- | src/leap/services/eip/vpnlaunchers.py | 11 | ||||
-rw-r--r-- | src/leap/util/leap_argparse.py | 2 |
12 files changed, 349 insertions, 283 deletions
@@ -20,11 +20,9 @@ TRANSLAT_DIR = data/translations PROJFILE = data/leap_client.pro #UI files to compile -# UI_FILES = foo.ui UI_FILES = mainwindow.ui wizard.ui #Qt resource files to compile -#images.qrc -RESOURCES = mainwindow.qrc # locale.qrc +RESOURCES = mainwindow.qrc locale.qrc #pyuic4 and pyrcc4 binaries PYUIC = pyside-uic diff --git a/data/leap_client.pro b/data/leap_client.pro index 9ec1a43b..e91497c0 100644 --- a/data/leap_client.pro +++ b/data/leap_client.pro @@ -2,7 +2,32 @@ # is not there a f*** way of expanding this? other to template with python I mean... -# SOURCES += ... +SOURCES += ../src/leap/gui/mainwindow.py \ + ../src/leap/gui/wizardpage.py \ + ../src/leap/gui/wizard.py \ + ../src/leap/config/provider_spec.py \ + ../src/leap/config/pluggableconfig.py \ + ../src/leap/config/providerconfig.py \ + ../src/leap/config/prefixers.py \ + ../src/leap/config/baseconfig.py \ + ../src/leap/app.py \ + ../src/leap/util/checkerthread.py \ + ../src/leap/util/leap_argparse.py \ + ../src/leap/util/check.py \ + ../src/leap/crypto/constants.py \ + ../src/leap/crypto/srpauth.py \ + ../src/leap/crypto/srpregister.py \ + ../src/leap/services/eip/eipbootstrapper.py \ + ../src/leap/services/eip/udstelnet.py \ + ../src/leap/services/eip/eipspec.py \ + ../src/leap/services/eip/vpn.py \ + ../src/leap/services/eip/vpnlaunchers.py \ + ../src/leap/services/eip/providerbootstrapper.py \ + ../src/leap/services/eip/eipconfig.py + +FORMS += ../src/leap/gui/ui/mainwindow.ui \ + ../src/leap/gui/ui/wizard.ui + # where to generate ts files -- tx will pick from here # original file, english diff --git a/data/ts/en_US.ts b/data/ts/en_US.ts index d2cba837..0c21d4f8 100644 --- a/data/ts/en_US.ts +++ b/data/ts/en_US.ts @@ -1,476 +1,496 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS><TS version="2.0"> <context> - <name>ConnectionPage</name> + <name>MainWindow</name> <message> - <location filename="../src/leap/gui/firstrun/connect.py" line="26"/> - <source>Connecting...</source> + <location filename="../src/leap/gui/mainwindow.py" line="550"/> + <source>Encryption is OFF</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/connect.py" line="27"/> - <source>Setting up a encrypted connection with the provider</source> + <location filename="../src/leap/gui/mainwindow.py" line="148"/> + <source>Stop</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/connect.py" line="85"/> - <source>Getting EIP configuration files</source> + <location filename="../src/leap/gui/mainwindow.py" line="231"/> + <source>Hide</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/connect.py" line="101"/> - <source>Authentication error: %s</source> + <location filename="../src/leap/gui/mainwindow.py" line="233"/> + <source>Show</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/connect.py" line="109"/> - <source>Getting EIP certificate</source> + <location filename="../src/leap/gui/mainwindow.py" line="262"/> + <source>About LEAP</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>EIPConductorAppMixin</name> <message> - <location filename="../src/leap/baseapp/eip.py" line="221"/> - <source>&Disconnect</source> + <location filename="../src/leap/gui/mainwindow.py" line="262"/> + <source>LEAP is a non-profit dedicated to giving all internet users access to secure communication. Our focus is on adapting encryption technology to make it easy to use and widely available. <a href="https://leap.se">More about LEAP</a></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/eip.py" line="235"/> - <source>&Connect</source> + <location filename="../src/leap/gui/mainwindow.py" line="405"/> + <source>Could not load provider configuration</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>EIPErrors</name> <message> - <location filename="../src/leap/eip/exceptions.py" line="66"/> - <source>We could not find any authentication agent in your system.<br/>Make sure you have <b>polkit-gnome-authentication-agent-1</b> running and try again.</source> + <location filename="../src/leap/gui/mainwindow.py" line="431"/> + <source>Please select a valid provider</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/eip/exceptions.py" line="77"/> - <source>We could not find <b>pkexec</b> in your system.<br/> Do you want to try <b>setuid workaround</b>? (<i>DOES NOTHING YET</i>)</source> + <location filename="../src/leap/gui/mainwindow.py" line="435"/> + <source>Please provide a valid username</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/eip/exceptions.py" line="88"/> - <source>No suitable openvpn command found. <br/>(Might be a permissions problem)</source> + <location filename="../src/leap/gui/mainwindow.py" line="439"/> + <source>Please provide a valid Password</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/eip/exceptions.py" line="97"/> - <source>there is a problem with provider certificate</source> + <location filename="../src/leap/gui/mainwindow.py" line="442"/> + <source>Logging in...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/eip/exceptions.py" line="104"/> - <source>an error occurred during configuratio of leap services</source> + <location filename="../src/leap/gui/mainwindow.py" line="507"/> + <source>Stop EIP</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/eip/exceptions.py" line="119"/> - <source>Server does not allow secure connections</source> + <location filename="../src/leap/gui/mainwindow.py" line="516"/> + <source>EIP has stopped</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/eip/exceptions.py" line="126"/> - <source>Server certificate could not be verified</source> + <location filename="../src/leap/gui/mainwindow.py" line="518"/> + <source>Start EIP</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/eip/exceptions.py" line="137"/> - <source>We could not find your eip certs in the expected path</source> + <location filename="../src/leap/gui/mainwindow.py" line="531"/> + <source>Checking configuration, please wait...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/eip/exceptions.py" line="111"/> - <source>Another OpenVPN Process has been detected. Please close it before starting leap-client</source> + <location filename="../src/leap/gui/mainwindow.py" line="539"/> + <source>%s does not support EIP</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>Errors</name> <message> - <location filename="../src/leap/base/exceptions.py" line="57"/> - <source>Interface not found</source> + <location filename="../src/leap/gui/mainwindow.py" line="554"/> + <source>Encryption is ON</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/base/exceptions.py" line="64"/> - <source>Looks like your computer is not connected to the internet</source> + <location filename="../src/leap/gui/mainwindow.py" line="572"/> + <source>VPN: Authenticating...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/base/exceptions.py" line="72"/> - <source>Looks like there are problems with your internet connection</source> + <location filename="../src/leap/gui/mainwindow.py" line="574"/> + <source>VPN: Retrieving configuration...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/base/exceptions.py" line="80"/> - <source>It looks like there is no internet connection.</source> + <location filename="../src/leap/gui/mainwindow.py" line="576"/> + <source>VPN: Connected!</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/base/exceptions.py" line="88"/> - <source>Domain cannot be found</source> + <location filename="../src/leap/gui/mainwindow.py" line="630"/> + <source>Signing out...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/base/exceptions.py" line="95"/> - <source>The Encrypted Connection was lost.</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="14"/> + <source>LEAP</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>IntroPage</name> <message> - <location filename="../src/leap/gui/firstrun/intro.py" line="14"/> - <source>First run wizard</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="83"/> + <source>Remember</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/intro.py" line="37"/> - <source>Sign up for a new account</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="90"/> + <source>Login</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/intro.py" line="40"/> - <source>Log In with my credentials</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="123"/> + <source><b>Provider:</b></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/intro.py" line="24"/> - <source>Now we will guide you through some configuration that is needed before you can connect for the first time.<br><br>If you ever need to modify these options again, you can find the wizard in the '<i>Settings</i>' menu from the main window.<br><br>Do you want to <b>sign up</b> for a new account, or <b>log in</b> with an already existing username?<br></source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="133"/> + <source><b>Password:</b></source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>LastPage</name> <message> - <location filename="../src/leap/gui/firstrun/last.py" line="18"/> - <source>Connecting to Encrypted Internet Proxy service...</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="153"/> + <source><b>User:</b></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/last.py" line="66"/> - <source>Click '<i>%s</i>' to end the wizard and save your settings.</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="209"/> + <source>0.0 Kb</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/last.py" line="62"/> - <source>You are now using an encrypted connection!</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="262"/> + <source>Disconnected</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>LogInPage</name> <message> - <location filename="../src/leap/gui/firstrun/login.py" line="96"/> - <source>Username must be in the username@provider form.</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="322"/> + <source>&Session</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/login.py" line="140"/> - <source>Resolving domain name</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="330"/> + <source>Help</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/login.py" line="163"/> - <source>Authentication error: %s</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="338"/> + <source>S&ettings</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/login.py" line="179"/> - <source>Credentials validated.</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="349"/> + <source>&Sign out</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/login.py" line="24"/> - <source>Log In</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="354"/> + <source>&Quit</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/login.py" line="38"/> - <source>User &name:</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="359"/> + <source>About &LEAP</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/login.py" line="53"/> - <source>&Password:</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="364"/> + <source>&Help</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/login.py" line="80"/> - <source>Log in</source> + <location filename="../src/leap/gui/ui/mainwindow.ui" line="369"/> + <source>&Wizard</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/login.py" line="25"/> - <source>Log in with your credentials</source> + <location filename="../src/leap/gui/mainwindow.py" line="578"/> + <source>VPN: Waiting to start...</source> <translation type="unfinished"></translation> </message> </context> <context> - <name>LogPaneMixin</name> + <name>Wizard</name> <message> - <location filename="../src/leap/baseapp/log.py" line="25"/> - <source>&Connect</source> + <location filename="../src/leap/gui/wizard.py" line="155"/> + <source>Refrain from using non ASCII characters like á, ñ, æ</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/log.py" line="38"/> - <source>Disconnected</source> + <location filename="../src/leap/gui/wizard.py" line="159"/> + <source>Passwords don't match</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>ProviderInfoPage</name> <message> - <location filename="../src/leap/gui/firstrun/providerinfo.py" line="19"/> - <source>Provider Information</source> + <location filename="../src/leap/gui/wizard.py" line="162"/> + <source>Password too short</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerinfo.py" line="20"/> - <source>Services offered by this provider</source> + <location filename="../src/leap/gui/wizard.py" line="165"/> + <source>Password too easy</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerinfo.py" line="95"/> - <source>enrollment policy</source> + <location filename="../src/leap/gui/wizard.py" line="168"/> + <source>Password equal to username</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>ProviderSetupValidationPage</name> <message> - <location filename="../src/leap/gui/firstrun/providersetup.py" line="28"/> - <source>Provider setup</source> + <location filename="../src/leap/gui/wizard.py" line="194"/> + <source>Starting registration...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providersetup.py" line="85"/> - <source>Fetching CA certificate</source> + <location filename="../src/leap/gui/wizard.py" line="200"/> + <source><font color='green'><b>User registration OK</b></font></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providersetup.py" line="107"/> - <source>Checking CA fingerprint</source> + <location filename="../src/leap/gui/wizard.py" line="207"/> + <source>Unknown error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providersetup.py" line="125"/> - <source>Validating api certificate</source> + <location filename="../src/leap/gui/wizard.py" line="308"/> + <source>Unable to load provider configuration</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providersetup.py" line="29"/> - <source>Gathering configuration options for this provider</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="14"/> + <source>LEAP First run</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>RegisterUserPage</name> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="31"/> - <source>Sign Up</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="31"/> + <source>Welcome</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="208"/> - <source>Registration succeeded!</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="34"/> + <source>This is the LEAP Client first run wizard</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="244"/> - <source>Password does not match..</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="43"/> + <source>Log In with my credentials</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="248"/> - <source>Password too short.</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="50"/> + <source><html><head/><body><p>Now we will guide you through some configuration that is needed before you can connect for the first time.</p><p>If you ever need to modify these options again, you can find the wizard in the <span style=" font-style:italic;">'Settings'</span> menu from the main window.</p><p>Do you want to <span style=" font-weight:600;">sign up</span> for a new account, or <span style=" font-weight:600;">log in</span> with an already existing username?</p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="253"/> - <source>Password too obvious.</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="63"/> + <source>Sign up for a new account</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="282"/> - <source>Error connecting to provider (timeout)</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="100"/> + <source>Provider selection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="287"/> - <source>Error Connecting to provider (connerr).</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="103"/> + <source>Please enter the domain of the provider you want to user for your connection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="295"/> - <source>Error during registration (%s)</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="128"/> + <source>https://</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="305"/> - <source>Could not register (bad response)</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="368"/> + <source>Checking provider</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="312"/> - <source>Username not available.</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="147"/> + <source>Download provider information</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="48"/> - <source>User &name:</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="154"/> + <source>HTTPS Connection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="60"/> - <source>&Password:</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="209"/> + <source>Name resolution</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="66"/> - <source>Password (again):</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="232"/> + <source>Check</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="72"/> - <source>&Remember username and password.</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="253"/> + <source>Provider Information</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/register.py" line="378"/> - <source>Register a new user with provider <em>%s</em></source> + <location filename="../src/leap/gui/ui/wizard.ui" line="256"/> + <source>Services offered by this provider</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>SelectProviderPage</name> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="32"/> - <source>Enter Provider</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="278"/> + <source><b>Enrollment policy:</b></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="87"/> - <source>chec&k!</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="285"/> + <source>URL</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="97"/> - <source>Server certificate could not be verified.</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="292"/> + <source>Name</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="136"/> - <source>Certificate validation</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="325"/> + <source>policy</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="290"/> - <source>Could not get info from provider.</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="332"/> + <source>Desc</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="293"/> - <source>Could not download provider info (refused conn.).</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="356"/> + <source>Provider setup</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="359"/> + <source>Gathering configuration options for this provider</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="406"/> + <source>Download CA Certificate</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="413"/> + <source>Check CA Certificate Fingerprint</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="420"/> + <source>Check API Certificate</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="486"/> + <source>Register new user</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="103"/> - <source>&Trust this provider certificate.</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="489"/> + <source>Register a new user with provider</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="344"/> - <source>Do you want to <b>trust this provider certificate?</b></source> + <location filename="../src/leap/gui/ui/wizard.ui" line="524"/> + <source><b>User:</b></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="347"/> - <source>SHA-256 fingerprint: <i>%s</i><br></source> + <location filename="../src/leap/gui/ui/wizard.ui" line="534"/> + <source><b>Password:</b></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="33"/> - <source>Please enter the domain of the provider you want to use for your connection</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="553"/> + <source><b>Re-enter password:</b></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="222"/> - <source>Checking if it is a valid provider</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="563"/> + <source>Register</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="276"/> - <source>Checking for a secure connection</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="584"/> + <source>EIP Setup</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/gui/firstrun/providerselect.py" line="303"/> - <source>Getting info from the provider</source> + <location filename="../src/leap/gui/ui/wizard.ui" line="587"/> + <source>Setting up Encrypted Internet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="609"/> + <source>Checking EIP</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="615"/> + <source>Download EIP configuration</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="622"/> + <source>Download client certificate</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="691"/> + <source>Congratulations!</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/leap/gui/ui/wizard.ui" line="694"/> + <source>You have successfully configured the LEAP client.</source> <translation type="unfinished"></translation> </message> </context> <context> - <name>StatusAwareTrayIconMixin</name> + <name>__impl</name> <message> - <location filename="../src/leap/baseapp/systray.py" line="78"/> - <source>EIP Connection Status</source> + <location filename="../src/leap/crypto/srpauth.py" line="159"/> + <source>Unknown user</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="87"/> - <source><b>disconnected</b></source> + <location filename="../src/leap/crypto/srpauth.py" line="165"/> + <source>The server did not send the salt parameter</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="126"/> - <source>Encryption ON turn &off</source> + <location filename="../src/leap/crypto/srpauth.py" line="169"/> + <source>The server did not send the B parameter</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="131"/> - <source>&Details...</source> + <location filename="../src/leap/crypto/srpauth.py" line="197"/> + <source>The data sent from the server had errors</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="135"/> - <source>&About</source> + <location filename="../src/leap/crypto/srpauth.py" line="218"/> + <source>Could not connect to the server</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="138"/> - <source>About Q&t</source> + <location filename="../src/leap/crypto/srpauth.py" line="226"/> + <source>Wrong password</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="141"/> - <source>&Quit</source> + <location filename="../src/leap/crypto/srpauth.py" line="232"/> + <source>Unknown error (%s)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="152"/> - <source>Encryption ON turn o&ff</source> + <location filename="../src/leap/crypto/srpauth.py" line="241"/> + <source>Problem getting data from server</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="157"/> - <source>Encryption OFF turn &on</source> + <location filename="../src/leap/crypto/srpauth.py" line="262"/> + <source>Bad data from server</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="162"/> - <source>connecting...</source> + <location filename="../src/leap/crypto/srpauth.py" line="268"/> + <source>Auth verification failed</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../src/leap/baseapp/systray.py" line="185"/> - <source>About</source> + <location filename="../src/leap/crypto/srpauth.py" line="398"/> + <source>Succeeded</source> <translation type="unfinished"></translation> </message> </context> diff --git a/src/leap/app.py b/src/leap/app.py index fa50cd1e..743ea6ea 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -27,8 +27,7 @@ from PySide import QtCore, QtGui VERSION = "unknown" from leap.util import leap_argparse -# TODO: add translations -#from leap.gui import locale_rc +from leap.gui import locale_rc from leap.gui.mainwindow import MainWindow diff --git a/src/leap/config/baseconfig.py b/src/leap/config/baseconfig.py index b80fd419..b6890d09 100644 --- a/src/leap/config/baseconfig.py +++ b/src/leap/config/baseconfig.py @@ -159,10 +159,13 @@ class LocalizedKey(object): """ descriptions = self._func(instance) description_lang = "" - if lang in descriptions.keys(): - description_lang = descriptions[lang] - else: - logger.warning("Unknown language: %s" % (lang,)) + config_lang = "en" + for key in descriptions.keys(): + if lang.startswith(key): + config_lang = key + break + + description_lang = descriptions[config_lang] return description_lang def __get__(self, instance, instancetype): diff --git a/src/leap/crypto/srpauth.py b/src/leap/crypto/srpauth.py index 28e4f037..8530b7da 100644 --- a/src/leap/crypto/srpauth.py +++ b/src/leap/crypto/srpauth.py @@ -156,18 +156,18 @@ class SRPAuth(QtCore.QObject): "Status code = %r. Content: %r" % (init_session.status_code, init_session.content)) if init_session.status_code == 422: - raise SRPAuthenticationError("Unknown user") + raise SRPAuthenticationError(self.tr("Unknown user")) salt = init_session.json().get("salt", None) B = init_session.json().get("B", None) if salt is None: logger.error("No salt parameter sent") - raise SRPAuthenticationError("The server did not send the " + - "salt parameter") + raise SRPAuthenticationError(self.tr("The server did not send " + "the salt parameter")) if B is None: logger.error("No B parameter sent") - raise SRPAuthenticationError("The server did not send the " + - "B parameter") + raise SRPAuthenticationError(self.tr("The server did not send " + "the B parameter")) return salt, B @@ -194,8 +194,8 @@ class SRPAuth(QtCore.QObject): unhex_B = self._safe_unhexlify(B) except TypeError as e: logger.error("Bad data from server: %r" % (e,)) - raise SRPAuthenticationError("The data sent from the server " - "had errors") + raise SRPAuthenticationError(self.tr("The data sent from " + "the server had errors")) M = self._srp_user.process_challenge(unhex_salt, unhex_B) auth_url = "%s/%s/%s/%s" % (self._provider_config.get_api_uri(), @@ -215,20 +215,21 @@ class SRPAuth(QtCore.QObject): get_ca_cert_path()) except requests.exceptions.ConnectionError as e: logger.error("No connection made (HAMK): %r" % (e,)) - raise SRPAuthenticationError("Could not connect to the server") + raise SRPAuthenticationError(self.tr("Could not connect to " + "the server")) if auth_result.status_code == 422: logger.error("[%s] Wrong password (HAMK): [%s]" % (auth_result.status_code, auth_result.json(). get("errors", ""))) - raise SRPAuthenticationError("Wrong password") + raise SRPAuthenticationError(self.tr("Wrong password")) if auth_result.status_code not in (200,): logger.error("No valid response (HAMK): " "Status code = %s. Content = %r" % (auth_result.status_code, auth_result.content)) - raise SRPAuthenticationError("Unknown error (%s)" % + raise SRPAuthenticationError(self.tr("Unknown error (%s)") % (auth_result.status_code,)) M2 = auth_result.json().get("M2", None) @@ -237,8 +238,8 @@ class SRPAuth(QtCore.QObject): if M2 is None or self.get_uid() is None: logger.error("Something went wrong. Content = %r" % (auth_result.content,)) - raise SRPAuthenticationError("Problem getting data from" - " server") + raise SRPAuthenticationError(self.tr("Problem getting data " + "from server")) return M2 @@ -258,13 +259,14 @@ class SRPAuth(QtCore.QObject): unhex_M2 = self._safe_unhexlify(M2) except TypeError: logger.error("Bad data from server (HAWK)") - raise SRPAuthenticationError("Bad data from server") + raise SRPAuthenticationError(self.tr("Bad data from server")) self._srp_user.verify_session(unhex_M2) if not self._srp_user.authenticated(): logger.error("Auth verification failed") - raise SRPAuthenticationError("Auth verification failed") + raise SRPAuthenticationError(self.tr("Auth verification " + "failed")) logger.debug("Session verified.") self.set_session_id(self._session.cookies["_session_id"]) @@ -379,7 +381,7 @@ class SRPAuth(QtCore.QObject): self.__instance.authenticate(username, password) logger.debug("Successful login!") - self.authentication_finished.emit(True, "Succeeded") + self.authentication_finished.emit(True, self.tr("Succeeded")) return True except Exception as e: logger.error("Error logging in %s" % (e,)) @@ -393,7 +395,7 @@ class SRPAuth(QtCore.QObject): """ try: self.__instance.logout() - self.logout_finished.emit(True, "Succeeded") + self.logout_finished.emit(True, self.tr("Succeeded")) return True except Exception as e: self.logout_finished.emit(False, "%s" % (e,)) diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index df21a2bb..d66ddbb5 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -20,6 +20,7 @@ Main window for the leap client """ import os import logging +import random from PySide import QtCore, QtGui @@ -141,9 +142,10 @@ class MainWindow(QtGui.QMainWindow): self._systray = None self._vpn_systray = None - self._action_eip_status = QtGui.QAction("Encryption is OFF", self) + self._action_eip_status = QtGui.QAction(self.tr("Encryption is OFF"), + self) self._action_eip_status.setEnabled(False) - self._action_eip_stop = QtGui.QAction("Stop", self) + self._action_eip_stop = QtGui.QAction(self.tr("Stop"), self) self._action_eip_stop.triggered.connect( self._stop_eip) self._action_eip_write = QtGui.QAction( @@ -155,7 +157,7 @@ class MainWindow(QtGui.QMainWindow): "0.0 Kb", self) self._action_eip_read.setEnabled(False) - self._action_visible = QtGui.QAction("Hide", self) + self._action_visible = QtGui.QAction(self.tr("Hide"), self) self._action_visible.triggered.connect(self._toggle_visible) self._center_window() @@ -226,9 +228,9 @@ class MainWindow(QtGui.QMainWindow): Toggles the window visibility """ self.setVisible(not self.isVisible()) - action_visible_text = "Hide" + action_visible_text = self.tr("Hide") if not self.isVisible(): - action_visible_text = "Show" + action_visible_text = self.tr("Show") self._action_visible.setText(action_visible_text) def _center_window(self): @@ -257,14 +259,15 @@ class MainWindow(QtGui.QMainWindow): """ Display the About LEAP dialog """ - QtGui.QMessageBox.about(self, "About LEAP", - "LEAP is a non-profit dedicated to giving " - "all internet users access to secure " - "communication. Our focus is on adapting " - "encryption technology to make it easy to use " - "and widely available. " - "<a href=\"https://leap.se\">More about LEAP" - "</a>") + QtGui.QMessageBox.about( + self, self.tr("About LEAP"), + self.tr("LEAP is a non-profit dedicated to giving " + "all internet users access to secure " + "communication. Our focus is on adapting " + "encryption technology to make it easy to use " + "and widely available. " + "<a href=\"https://leap.se\">More about LEAP" + "</a>")) def quit(self): self._really_quit = True @@ -399,7 +402,8 @@ class MainWindow(QtGui.QMainWindow): self._provider_config, download_if_needed=True) else: - self._set_status("Could not load provider configuration") + self._set_status( + self.tr("Could not load provider configuration")) self._login_set_enabled(True) else: self._set_status(data[self._provider_bootstrapper.ERROR_KEY]) @@ -424,18 +428,18 @@ class MainWindow(QtGui.QMainWindow): provider = self.ui.cmbProviders.currentText() if len(provider) == 0: - self._set_status("Please select a valid provider") + self._set_status(self.tr("Please select a valid provider")) return if len(username) == 0: - self._set_status("Please provide a valid username") + self._set_status(self.tr("Please provide a valid username")) return if len(password) == 0: - self._set_status("Please provide a valid Password") + self._set_status(self.tr("Please provide a valid Password")) return - self._set_status("Logging in...") + self._set_status(self.tr("Logging in...")) self._login_set_enabled(False) self._download_provider_config() @@ -496,11 +500,11 @@ class MainWindow(QtGui.QMainWindow): def _start_eip(self): self._vpn.start(eipconfig=self._eip_config, providerconfig=self._provider_config, - socket_host="/home/chiiph/vpnsock", - socket_port="unix") + socket_host="localhost", + socket_port=str(random.randint(1000, 9999))) self._vpn_systray.setVisible(True) self.ui.btnEipStartStop.setEnabled(True) - self.ui.btnEipStartStop.setText("Stop EIP") + self.ui.btnEipStartStop.setText(self.tr("Stop EIP")) self.ui.btnEipStartStop.clicked.disconnect( self._start_eip) self.ui.btnEipStartStop.clicked.connect( @@ -509,9 +513,9 @@ class MainWindow(QtGui.QMainWindow): def _stop_eip(self): self._vpn.set_should_quit() self._vpn_systray.setVisible(False) - self._set_eip_status("EIP has stopped") + self._set_eip_status(self.tr("EIP has stopped")) self._set_eip_status_icon("error") - self.ui.btnEipStartStop.setText("Start EIP") + self.ui.btnEipStartStop.setText(self.tr("Start EIP")) self.ui.btnEipStartStop.clicked.disconnect( self._stop_eip) self.ui.btnEipStartStop.clicked.connect( @@ -524,7 +528,7 @@ class MainWindow(QtGui.QMainWindow): leap_assert(self._eip_bootstrapper, "We need an eip bootstrapper!") leap_assert(self._provider_config, "We need a provider config") - self._set_eip_status("Checking configuration, please wait...") + self._set_eip_status(self.tr("Checking configuration, please wait...")) if self._provider_config.provides_eip(): self._eip_bootstrapper.run_eip_setup_checks( @@ -532,7 +536,7 @@ class MainWindow(QtGui.QMainWindow): self._provider_config, download_if_needed=True) else: - self._set_eip_status("%s does not support EIP" % + self._set_eip_status(self.tr("%s does not support EIP") % (self._provider_config.get_domain(),)) def _set_eip_status_icon(self, status): @@ -543,11 +547,11 @@ class MainWindow(QtGui.QMainWindow): @type status: str """ selected_pixmap = self.ERROR_ICON - tray_message = "Encryption is OFF" - if status in ("AUTH", "GET_CONFIG"): + tray_message = self.tr("Encryption is OFF") + if status in ("WAIT", "AUTH", "GET_CONFIG"): selected_pixmap = self.CONNECTING_ICON elif status in ("CONNECTED"): - tray_message = "Encryption is ON" + tray_message = self.tr("Encryption is ON") selected_pixmap = self.CONNECTED_ICON self.ui.lblVPNStatusIcon.setPixmap(selected_pixmap) @@ -565,11 +569,13 @@ class MainWindow(QtGui.QMainWindow): status = data[self._vpn.STATUS_STEP_KEY] self._set_eip_status_icon(status) if status == "AUTH": - self._set_eip_status("VPN: Authenticating...") + self._set_eip_status(self.tr("VPN: Authenticating...")) elif status == "GET_CONFIG": - self._set_eip_status("VPN: Retrieving configuration...") + self._set_eip_status(self.tr("VPN: Retrieving configuration...")) elif status == "CONNECTED": - self._set_eip_status("VPN: Connected!") + self._set_eip_status(self.tr("VPN: Connected!")) + elif status == "WAIT": + self._set_eip_status(self.tr("VPN: Waiting to start...")) else: self._set_eip_status(status) @@ -621,8 +627,8 @@ class MainWindow(QtGui.QMainWindow): Starts the logout sequence """ self._set_eip_status_icon("error") - self._set_eip_status("Signing out...") - self._srp_auth.logout() + self._set_eip_status(self.tr("Signing out...")) + self._checker_thread.add_checks([self._srp_auth.logout]) def _done_logging_out(self, ok, message): """ diff --git a/src/leap/gui/ui/wizard.ui b/src/leap/gui/ui/wizard.ui index 2d9cb441..a7198c5f 100644 --- a/src/leap/gui/ui/wizard.ui +++ b/src/leap/gui/ui/wizard.ui @@ -798,6 +798,7 @@ </tabstops> <resources> <include location="../../../../data/resources/mainwindow.qrc"/> + <include location="../../../../data/resources/locale.qrc"/> </resources> <connections/> </ui> diff --git a/src/leap/gui/wizard.py b/src/leap/gui/wizard.py index bac74d1d..fa705645 100644 --- a/src/leap/gui/wizard.py +++ b/src/leap/gui/wizard.py @@ -21,7 +21,7 @@ First run wizard import os import logging -from PySide import QtGui +from PySide import QtCore, QtGui from functools import partial from ui_wizard import Ui_Wizard @@ -152,19 +152,20 @@ class Wizard(QtGui.QWizard): username.encode("ascii") password.encode("ascii") except: - message = u"Refrain from using non ASCII áñ characters" + message = self.tr(u"Refrain from using non " + u"ASCII characters like á, ñ, æ") if message is not None and password != password2: - message = "Passwords don't match" + message = self.tr("Passwords don't match") if message is None and len(password) < 6: - message = "Password too short" + message = self.tr("Password too short") if message is None and password in self.WEAK_PASSWORDS: - message = "Password too easy" + message = self.tr("Password too easy") if message is None and username == password: - message = "Password equal to username" + message = self.tr("Password equal to username") if message is not None: self._set_register_status(message) @@ -190,20 +191,20 @@ class Wizard(QtGui.QWizard): self._checker_thread.add_checks( [partial(register.register_user, username, password)]) self._username = username - self._set_register_status("Starting registration...") + self._set_register_status(self.tr("Starting registration...")) else: self.ui.btnRegister.setEnabled(True) def _registration_finished(self, ok, req): if ok: - self._set_register_status("<font color='green'>" - "<b>User registration OK</b></font>") + self._set_register_status(self.tr("<font color='green'>" + "<b>User registration OK</b></font>")) self.ui.lblPassword2.clearFocus() self.page(self.REGISTER_USER_PAGE).set_completed() self.button(QtGui.QWizard.BackButton).setEnabled(False) else: self._username = None - error_msg = "Unknown error" + error_msg = self.tr("Unknown error") try: error_msg = req.json().get("errors").get("login")[0] except: @@ -304,7 +305,7 @@ class Wizard(QtGui.QWizard): new_data = { self._provider_bootstrapper.PASSED_KEY: False, self._provider_bootstrapper.ERROR_KEY: - "Unable to load provider configuration" + self.tr("Unable to load provider configuration") } self._complete_task(new_data, self.ui.lblProviderInfo) @@ -387,13 +388,14 @@ class Wizard(QtGui.QWizard): if pageId == self.PRESENT_PROVIDER_PAGE: # TODO: get the right lang for these + lang = QtCore.QLocale.system().name() self.ui.lblProviderName.setText( "<b>%s</b>" % - (self._provider_config.get_name(),)) + (self._provider_config.get_name(lang=lang),)) self.ui.lblProviderURL.setText(self._provider_config.get_domain()) self.ui.lblProviderDesc.setText( "<i>%s</i>" % - (self._provider_config.get_description(),)) + (self._provider_config.get_description(lang=lang),)) self.ui.lblProviderPolicy.setText(self._provider_config .get_enrollment_policy()) diff --git a/src/leap/services/eip/vpn.py b/src/leap/services/eip/vpn.py index 71944f50..3ec32f6f 100644 --- a/src/leap/services/eip/vpn.py +++ b/src/leap/services/eip/vpn.py @@ -31,7 +31,6 @@ from leap.services.eip.udstelnet import UDSTelnet from leap.util.check import leap_assert, leap_assert_type logger = logging.getLogger(__name__) -ON_POSIX = 'posix' in sys.builtin_module_names # TODO: abstract the thread that can be asked to quit to another @@ -103,6 +102,7 @@ class VPN(QtCore.QThread): self._send_command("signal SIGTERM") self._tn.close() self._subp.terminate() + self._subp.waitForFinished() except Exception as e: logger.debug("Could not terminate process, trying command " + "signal SIGNINT: %r" % (e,)) @@ -311,6 +311,9 @@ class VPN(QtCore.QThread): output_sofar = self._subp.readAllStandardOutput() if len(output_sofar) > 0: logger.debug(output_sofar) + output_sofar = self._subp.readAllStandardError() + if len(output_sofar) > 0: + logger.debug(output_sofar) QtCore.QThread.msleep(self.POLL_TIME) diff --git a/src/leap/services/eip/vpnlaunchers.py b/src/leap/services/eip/vpnlaunchers.py index 00e9c966..cf817321 100644 --- a/src/leap/services/eip/vpnlaunchers.py +++ b/src/leap/services/eip/vpnlaunchers.py @@ -215,8 +215,15 @@ class LinuxVPNLauncher(VPNLauncher): args += [ '--user', getpass.getuser(), - '--group', grp.getgrgid(os.getgroups()[-1]).gr_name, - '--management-client-user', getpass.getuser(), + '--group', grp.getgrgid(os.getgroups()[-1]).gr_name + ] + + if socket_port == "unix": + args += [ + '--management-client-user', getpass.getuser() + ] + + args += [ '--management-signal', '--management', socket_host, socket_port, '--script-security', '2' diff --git a/src/leap/util/leap_argparse.py b/src/leap/util/leap_argparse.py index 78597f63..83272a3d 100644 --- a/src/leap/util/leap_argparse.py +++ b/src/leap/util/leap_argparse.py @@ -20,7 +20,7 @@ import argparse def build_parser(): """ - all the options for the leap arg parser + All the options for the leap arg parser Some of these could be switched on only if debug flag is present! """ epilog = "Copyright 2012 The LEAP Encryption Access Project" |