From 5c0eb246d468454de9e84dca0d08c813459a5a6d Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 19 Dec 2012 07:45:02 +0900 Subject: documentation update! reSTructured (no pun intended) the sphinx docs, and trimmed README --- data/images/favicon.ico | Bin 0 -> 318 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 data/images/favicon.ico (limited to 'data') diff --git a/data/images/favicon.ico b/data/images/favicon.ico new file mode 100644 index 00000000..b5f3505a Binary files /dev/null and b/data/images/favicon.ico differ -- cgit v1.2.3 From d04c93134ad3daaee0ca280824ab3288bfc5029c Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 16 Nov 2012 22:59:16 +0900 Subject: initial translation example. --- data/leap_client.pro | 2 + data/mkpyqt.py | 271 +++++++++++++++++++++++++++++++++ data/resources/locale.qrc | 5 + data/translations/leap_client_es_ES.qm | Bin 0 -> 1450 bytes data/translations/leap_client_es_ES.ts | 26 ++++ 5 files changed, 304 insertions(+) create mode 100644 data/leap_client.pro create mode 100755 data/mkpyqt.py create mode 100644 data/resources/locale.qrc create mode 100644 data/translations/leap_client_es_ES.qm create mode 100644 data/translations/leap_client_es_ES.ts (limited to 'data') diff --git a/data/leap_client.pro b/data/leap_client.pro new file mode 100644 index 00000000..01fbafcd --- /dev/null +++ b/data/leap_client.pro @@ -0,0 +1,2 @@ +SOURCES += ../src/leap/gui/firstrun/intro.py +TRANSLATIONS += translations/leap_client_es_ES.ts diff --git a/data/mkpyqt.py b/data/mkpyqt.py new file mode 100755 index 00000000..1ce2cd28 --- /dev/null +++ b/data/mkpyqt.py @@ -0,0 +1,271 @@ +#!/usr/bin/env python +# Copyright (c) 2007-10 Qtrac Ltd. All rights reserved. +# This program or module is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 2 of the License, or +# version 3 of the License, or (at your option) any later version. It is +# provided for educational purposes and is distributed in the hope that +# it will be useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. + +import os +import platform +import stat +import subprocess +import sys +import PyQt4.QtCore + +__version__ = "1.0.4" + +Windows = sys.platform.lower().startswith(("win", "microsoft")) +if Windows: + PATH = os.path.join(os.path.dirname(sys.executable), + "Lib/site-packages/PyQt4") + if os.access(os.path.join(PATH, "bin"), os.R_OK): + PATH = os.path.join(PATH, "bin") +else: + app = PyQt4.QtCore.QCoreApplication([]) + PATH = unicode(app.applicationDirPath()) + del app +if sys.platform.startswith("darwin"): + i = PATH.find("Resources") + if i > -1: + PATH = PATH[:i] + "bin" +PYUIC4 = os.path.join(PATH, "pyuic4") # e.g. PYUIC4 = "/usr/bin/pyuic4" +if sys.platform.startswith("darwin"): + PYUIC4 = os.path.dirname(sys.executable) + i = PYUIC4.find("Resources") + if i > -1: + PYUIC4 = PYUIC4[:i] + "Lib/python2.5/site-packages/PyQt4/uic/pyuic.py" +PYRCC4 = os.path.join(PATH, "pyrcc4") +PYLUPDATE4 = os.path.join(PATH, "pylupdate4") +LRELEASE = "lrelease" +if Windows: + PYUIC4 = PYUIC4.replace("/", "\\") + ".bat" + PYRCC4 = PYRCC4.replace("/", "\\") + ".exe" + PYLUPDATE4 = PYLUPDATE4.replace("/", "\\") + ".exe" + +msg = [] +shell = lambda command: subprocess.Popen(['which', command], + stdout=subprocess.PIPE).communicate() + +if not os.access(PYUIC4, os.F_OK): + PYUIC4 = shell('pyuic4')[0].strip('\n') + if not os.access(PYUIC4, os.F_OK): + msg.append("failed to find pyuic4; tried %s" % PYUIC4) + +if not os.access(PYRCC4, os.F_OK): + PYRCC4 = shell('pyrcc4')[0].strip('\n') + if not os.access(PYRCC4, os.F_OK): + msg.append("failed to find pyrcc4; tried %s" % PYRCC4) + +if not os.access(PYLUPDATE4, os.F_OK): + PYLUPDATE4 = shell('pylupdate4')[0].strip('\n') + if not os.access(PYLUPDATE4, os.F_OK): + msg.append("failed to find pylupdate4; tried %s" % PYLUPDATE4) + +if msg: + print "\n".join(msg) + print "try manually editing this program to put the correct " + \ + "paths in place" + sys.exit() + +Debug = False +Verbose = False + +def usage(): + print """usage: mkpyqt.py [options] [path] + +Options (which can be given in any of the forms shown): +-b --build build [default] +-c --clean clean +-f --force force +-t --translate translate +-r --recurse recurse +-v --verbose verbose +-D --debug debug +path defaults to . + +If executed with no arguments (or with a build argument) it does a +build, i.e., it looks for all *.ui and *.qrc files and makes sure that +the corresponding ui_*.py and qrc_*.py files exist and are up-to-date. + +If executed with clean, deletes all ui_*.py and qrc_*.py files that have +corresponding *.ui and *.qrc files, and all *.pyc and *.pyo files. + +If executed with force, it does a clean followed by a build. + +If building and the translate option is given, after building, it runs +pylupdate4 on all .py and .pyw files it encounters, and then runs lrelease +on all .ts files it encounters. It does not use a .pro file so the .ts +files must be created in the first place, e.g., using pylupdate4 on one +of the source files and using its -ts option. + +WARNING: Do not give any hand-coded files names that match ui_*.py or +qrc_*.py since these will be deleted by mkpyqt.py clean! + +NOTE: If any tool fails to run, e.g., pyuic4, then edit this program and +hard-code the path; the variables with the tool paths are near the top +of the file. + +mkpyqt.py v %s. Copyright (c) 2007-9 Qtrac Ltd. All rights reserved. +""" % __version__ + sys.exit() + + +def report_failure(command, args, process): + msg = "" + ba = process.readAllStandardError() + if not ba.isEmpty(): + msg = ": " + str(QString(ba)) + print "failed", command, " ".join(args), msg + + +def build(path): + for name in os.listdir(path): + source = os.path.join(path, name) + target = None + if source.endswith(".ui"): + target = os.path.join(path, + "ui_" + name.replace(".ui", ".py")) + command = PYUIC4 + elif source.endswith(".qrc"): + target = os.path.join(path, + "qrc_" + name.replace(".qrc", ".py")) + command = PYRCC4 + process = PyQt4.QtCore.QProcess() + if target is not None: + if not os.access(target, os.F_OK) or ( + os.stat(source)[stat.ST_MTIME] > \ + os.stat(target)[stat.ST_MTIME]): + args = ["-o", target, source] + if sys.platform.startswith("darwin") and command == PYUIC4: + command = sys.executable + args = [PYUIC4] + args + if Debug: + print "# %s %s" % (command, " ".join(args)) + else: + process.start(command, args) + if not process.waitForFinished(2 * 60 * 1000): + report_failure(command, args, process) + else: + print source, "->", target + elif Verbose: + print source, "is up-to-date" + + +def clean(path): + deletelist = [] + for name in os.listdir(path): + target = os.path.join(path, name) + source = None + if target.endswith(".py") or target.endswith(".pyc") or \ + target.endswith(".pyo"): + if name.startswith("ui_") and not name[-1] in "oc": + source = os.path.join(path, name[3:-3] + ".ui") + elif name.startswith("qrc_"): + if target[-1] in "oc": + source = os.path.join(path, name[4:-4] + ".qrc") + else: + source = os.path.join(path, name[4:-3] + ".qrc") + elif target[-1] in "oc": + source = target[:-1] + if source is not None: + if os.access(source, os.F_OK): + if Debug: + print "# delete ", target + else: + deletelist.append(target) + else: + print "will not remove '%s' since `%s' not found" % ( + target, source) + if not Debug: + for target in deletelist: + if Verbose: + print "deleted", target + os.remove(target) + + +def translate(path): + files = [] + tsfiles = [] + for name in os.listdir(path): + if name.endswith((".py", ".pyw")): + files.append(os.path.join(path, name)) + elif name.endswith(".ts"): + tsfiles.append(os.path.join(path, name)) + if not tsfiles: + return + verbose = "-verbose" if Verbose else "" + silent = "-silent" if not Verbose else "" + process = PyQt4.QtCore.QProcess() + for ts in tsfiles: + qm = ts[:-3] + ".qm" + command1 = PYLUPDATE4 + args1 = [verbose] + files + ["-ts", ts] + command2 = LRELEASE + args2 = [silent, ts, "-qm", qm] + if Debug: + print "updated", ts + print "generated", qm + else: + process.start(command1, args1) + if not process.waitForFinished(2 * 60 * 1000): + report_failure(command1, args1, process) + process.start(command2, args2) + if not process.waitForFinished(2 * 60 * 1000): + report_failure(command2, args2, process) + + +def apply(recurse, function, path): + if not recurse: + function(path) + else: + for root, dirs, files in os.walk(path): + for dir in dirs: + function(os.path.join(root, dir)) + + +def main(): + global Debug, Verbose + function = build + recurse = False + trans = False + force = False + path = "." + args = sys.argv[1:] + while args: + arg = args.pop(0) + if arg in ("-D", "--debug", "debug"): + Debug = True + elif arg in ("-b", "--build", "build"): + pass # This is the default + elif arg in ("-c", "--clean", "clean"): + function = clean + elif arg in ("-f", "--force", "force"): + force = True + elif arg in ("-t", "--translate", "translate"): + trans = True + elif arg in ("-r", "--recurse", "recurse"): + recurse = True + elif arg in ("-v", "--verbose", "verbose"): + Verbose = True + elif arg in ("-h", "--help", "help"): + usage() + else: + path = arg + if not force: + apply(recurse, function, path) + else: + apply(recurse, clean, path) + apply(recurse, build, path) + if trans and (function == build or force): + apply(recurse, translate, path) + +main() + +# 1.0.1 Fixed bug reported by Brian Downing where paths that contained +# spaces were not handled correctly. +# 1.0.2 Changed default path on Windows to match PyQt 4.4 +# 1.0.3 Tried to make the paths work on Mac OS X diff --git a/data/resources/locale.qrc b/data/resources/locale.qrc new file mode 100644 index 00000000..a2fda78d --- /dev/null +++ b/data/resources/locale.qrc @@ -0,0 +1,5 @@ + + +../translations/leap_client_es_ES.qm + + diff --git a/data/translations/leap_client_es_ES.qm b/data/translations/leap_client_es_ES.qm new file mode 100644 index 00000000..002237e9 Binary files /dev/null and b/data/translations/leap_client_es_ES.qm differ diff --git a/data/translations/leap_client_es_ES.ts b/data/translations/leap_client_es_ES.ts new file mode 100644 index 00000000..86eee980 --- /dev/null +++ b/data/translations/leap_client_es_ES.ts @@ -0,0 +1,26 @@ + + + + IntroPage + + + First run wizard. + Primera conexion. + + + + 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> + Vamos a reunir la informacion que necesitas antes de la primera conexion.<br><br>Si alguna vez necesitas modificar estas opciones de nuevo, puedes encontrar este asistente en el menu <i>Opciones</i> en la ventana principal.<br><br>Que deseas hacer ahora? Puedes <b>registrar</b> una nueva cuenta o <b>loguearte</b> con una que ya tienes?<br> + + + + Sign up for a new account. + Registrar una cuenta nueva. + + + + Log In with my credentials. + Loguearme con mi usuario y contrasena. + + + -- cgit v1.2.3 From 06bccc52c84a93407ab4699a2749b24f55fe3061 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 20 Dec 2012 08:19:55 +0900 Subject: working transifex workflow Closes #666 --- data/leap_client.pro | 20 ++- data/resources/locale.qrc | 2 +- data/translations/README.rst | 8 ++ data/translations/es.qm | Bin 0 -> 6194 bytes data/translations/es.ts | 218 ++++++++++++++++++++++++++++++++ data/translations/leap_client_es_ES.qm | Bin 1450 -> 0 bytes data/translations/leap_client_es_ES.ts | 26 ---- data/ts/README.rst | 14 +++ data/ts/en_US.ts | 219 +++++++++++++++++++++++++++++++++ 9 files changed, 479 insertions(+), 28 deletions(-) create mode 100644 data/translations/README.rst create mode 100644 data/translations/es.qm create mode 100644 data/translations/es.ts delete mode 100644 data/translations/leap_client_es_ES.qm delete mode 100644 data/translations/leap_client_es_ES.ts create mode 100644 data/ts/README.rst create mode 100644 data/ts/en_US.ts (limited to 'data') diff --git a/data/leap_client.pro b/data/leap_client.pro index 01fbafcd..4c559029 100644 --- a/data/leap_client.pro +++ b/data/leap_client.pro @@ -1,2 +1,20 @@ +# qmake file + +# is not there a f*** way of expanding this? other to template with python I mean... + SOURCES += ../src/leap/gui/firstrun/intro.py -TRANSLATIONS += translations/leap_client_es_ES.ts +SOURCES += ../src/leap/gui/firstrun/last.py +SOURCES += ../src/leap/gui/firstrun/login.py +SOURCES += ../src/leap/gui/firstrun/providerinfo.py +SOURCES += ../src/leap/gui/firstrun/providerselect.py +SOURCES += ../src/leap/gui/firstrun/providersetup.py +SOURCES += ../src/leap/gui/firstrun/register.py +SOURCES += ../src/leap/gui/firstrun/regvalidation.py +SOURCES += ../src/leap/gui/firstrun/wizard.py + +# where to generate ts files -- tx will pick from here + +# original file, english + +TRANSLATIONS += ts/en_US.ts + diff --git a/data/resources/locale.qrc b/data/resources/locale.qrc index a2fda78d..53576b49 100644 --- a/data/resources/locale.qrc +++ b/data/resources/locale.qrc @@ -1,5 +1,5 @@ -../translations/leap_client_es_ES.qm +../translations/leap_client_es.qm diff --git a/data/translations/README.rst b/data/translations/README.rst new file mode 100644 index 00000000..1f3dd0b3 --- /dev/null +++ b/data/translations/README.rst @@ -0,0 +1,8 @@ +data/translations +================= + +We expect finished translations (i.e., those downloaded from ``transifex``) to live here. + +Translator object will pick them from here. + +(Actually, from the embedded locale_rc) diff --git a/data/translations/es.qm b/data/translations/es.qm new file mode 100644 index 00000000..8daa2037 Binary files /dev/null and b/data/translations/es.qm differ diff --git a/data/translations/es.ts b/data/translations/es.ts new file mode 100644 index 00000000..84aa6f0a --- /dev/null +++ b/data/translations/es.ts @@ -0,0 +1,218 @@ + + + IntroPage + + + First run wizard. + Primera Conexion. + + + + 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> + Vamos a configurar algunas cosas antes de que te puedas conectar por primera vez.<br><br>Si necesitas modificar estas opciones de nuevo, puedes encontrar este asistente en el menu de '<i>Opciones</i>' en la ventana principal.<br><br>Quieres <b>registrar</b> una nueva cuenta, o <b>loguearte</b> con tu usuario?<br> + + + + Sign up for a new account. + Registrar una cuenta nueva. + + + + Log In with my credentials. + Loguearme con un usuario que ya tengo. + + + + LogInPage + + + Username must be in the username@provider form. + El usuario tiene que ser usuario@tu.proveedor + + + + Resolving domain name + Resolviendo nombre de dominio + + + + Authentication error: %s + Error de autenticacion: %s + + + + Credentials validated. + Credenciales validadas. + + + + ProviderInfoPage + + + Provider Info + Info del Proveedor + + + + This is what provider says. + Esto es lo que dice el proveedor. + + + + ProviderSetupValidationPage + + + Provider setup + Configuracion del Proveedor + + + + Doing autoconfig. + Autoconfigurando. + + + + Fetching CA certificate + Obteniendo certificado de la CA + + + + Checking CA fingerprint + Comprobando el fingerprint de la CA + + + + Validating api certificate + Validando certificado de la api + + + + RegisterUserPage + + + Sign Up + Nueva Cuenta + + + + Registration succeeded! + Cuenta creada con exito! + + + + Password does not match.. + Las contrasenas no son iguales.. + + + + Password too short. + Contrasena demasiado corta. + + + + Password too obvious. + Contrasena demasiado obvia. + + + + Error connecting to provider (timeout) + Error conectandose al proveedor (timeout) + + + + Error Connecting to provider (connerr). + Error conectandose al proveedor (connerr). + + + + Error during registration (%s) + Error durante el registro (%s) + + + + Could not register (bad response) + No se pudo registrar (bad response) + + + + Username not available. + Usuario no disponible. + + + + Register a new user with provider %s. + Registrar un nuevo usuario con el proveedor %s. + + + + RegisterUserValidationPage + + + Fetching provider config... + Obteniendo configuracion del proveedor... + + + + Authentication error: %s + Error de autenticacion: %s + + + + Fetching eip certificate + Obteniendo certificado eip + + + + SelectProviderPage + + + Enter Provider + Entra tu Proveedor + + + + Please enter the domain of the provider you want to use for your connection. + Por favor, rellena el dominio del proveedor que quieras usar para tu conexion. + + + + chec&k! + compro&bar! + + + + Server certificate could not be verified. + No se pudo verificar el certificado del servidor. + + + + Certificate validation + Validacion del certificado + + + + checking domain name + comprobando nombre de dominio + + + + checking https connection + comprobando conexion https + + + + Could not get info from provider. + no se pudo obtener info del proveedor + + + + Could not download provider info (refused conn.). + no se pudo obtener info del proveedor (refused conn.). + + + + fetching provider info + obteniendo info del preveedor + + + \ No newline at end of file diff --git a/data/translations/leap_client_es_ES.qm b/data/translations/leap_client_es_ES.qm deleted file mode 100644 index 002237e9..00000000 Binary files a/data/translations/leap_client_es_ES.qm and /dev/null differ diff --git a/data/translations/leap_client_es_ES.ts b/data/translations/leap_client_es_ES.ts deleted file mode 100644 index 86eee980..00000000 --- a/data/translations/leap_client_es_ES.ts +++ /dev/null @@ -1,26 +0,0 @@ - - - - IntroPage - - - First run wizard. - Primera conexion. - - - - 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> - Vamos a reunir la informacion que necesitas antes de la primera conexion.<br><br>Si alguna vez necesitas modificar estas opciones de nuevo, puedes encontrar este asistente en el menu <i>Opciones</i> en la ventana principal.<br><br>Que deseas hacer ahora? Puedes <b>registrar</b> una nueva cuenta o <b>loguearte</b> con una que ya tienes?<br> - - - - Sign up for a new account. - Registrar una cuenta nueva. - - - - Log In with my credentials. - Loguearme con mi usuario y contrasena. - - - diff --git a/data/ts/README.rst b/data/ts/README.rst new file mode 100644 index 00000000..3db2d104 --- /dev/null +++ b/data/ts/README.rst @@ -0,0 +1,14 @@ +data/ts +======= + +Here we expect the .ts files generated by typing:: + + $ make translations + +Which will generate the sources (en_US) + +For uploading a source:: + + $ tx push -s + +Translator should pick finished ``.qm`` files from ``data/translations`` instead of this folder. diff --git a/data/ts/en_US.ts b/data/ts/en_US.ts new file mode 100644 index 00000000..f6aadc5c --- /dev/null +++ b/data/ts/en_US.ts @@ -0,0 +1,219 @@ + + + + IntroPage + + + First run wizard. + + + + + 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> + + + + + Sign up for a new account. + + + + + Log In with my credentials. + + + + + LogInPage + + + Username must be in the username@provider form. + + + + + Resolving domain name + + + + + Authentication error: %s + + + + + Credentials validated. + + + + + ProviderInfoPage + + + Provider Info + + + + + This is what provider says. + + + + + ProviderSetupValidationPage + + + Provider setup + + + + + Doing autoconfig. + + + + + Fetching CA certificate + + + + + Checking CA fingerprint + + + + + Validating api certificate + + + + + RegisterUserPage + + + Sign Up + + + + + Registration succeeded! + + + + + Password does not match.. + + + + + Password too short. + + + + + Password too obvious. + + + + + Error connecting to provider (timeout) + + + + + Error Connecting to provider (connerr). + + + + + Error during registration (%s) + + + + + Could not register (bad response) + + + + + Username not available. + + + + + Register a new user with provider %s. + + + + + RegisterUserValidationPage + + + Fetching provider config... + + + + + Authentication error: %s + + + + + Fetching eip certificate + + + + + SelectProviderPage + + + Enter Provider + + + + + Please enter the domain of the provider you want to use for your connection. + + + + + chec&k! + + + + + Server certificate could not be verified. + + + + + Certificate validation + + + + + checking domain name + + + + + checking https connection + + + + + Could not get info from provider. + + + + + Could not download provider info (refused conn.). + + + + + fetching provider info + + + + -- cgit v1.2.3