From 8982839794623612ba97fd9bb62f35cc81f0d176 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 10 Jun 2014 10:33:02 +0200 Subject: [PATCH] fixed translation_util script for 2.2 --- scripts/translation_utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/translation_utils.py b/scripts/translation_utils.py index 2e9dffb12..d98fe61c9 100755 --- a/scripts/translation_utils.py +++ b/scripts/translation_utils.py @@ -63,7 +63,7 @@ import webbrowser from optparse import OptionParser from PyQt4 import QtCore -SERVER_URL = 'http://www.transifex.net/api/2/project/openlp/' +SERVER_URL = 'http://www.transifex.net/api/2/project/openlp/resource/openlp-22x/' IGNORED_PATHS = ['scripts'] IGNORED_FILES = ['setup.py'] @@ -193,12 +193,11 @@ def download_translations(): if not password: password = getpass(' Transifex password: ') # First get the list of languages - url = SERVER_URL + 'resource/ents/' base64string = base64.encodebytes('%s:%s' % (username, password))[:-1] auth_header = 'Basic %s' % base64string - request = urllib.request.Request(url + '?details') + request = urllib.request.Request(SERVER_URL + '?details') request.add_header('Authorization', auth_header) - print_verbose('Downloading list of languages from: %s' % url) + print_verbose('Downloading list of languages from: %s' % SERVER_URL) try: json_response = urllib.request.urlopen(request) except urllib.error.HTTPError: @@ -207,7 +206,7 @@ def download_translations(): json_dict = json.loads(json_response.read()) languages = [lang['code'] for lang in json_dict['available_languages']] for language in languages: - lang_url = url + 'translation/%s/?file' % language + lang_url = SERVER_URL + 'translation/%s/?file' % language request = urllib.request.Request(lang_url) request.add_header('Authorization', auth_header) filename = os.path.join(os.path.abspath('..'), 'resources', 'i18n', language + '.ts')