From 5c73dbe4b4af5176c25ddabb7788833f67b22500 Mon Sep 17 00:00:00 2001 From: Kevin Goos Date: Mon, 19 Mar 2018 10:02:43 +0100 Subject: Cleanup of repo for merge --- src/org/traccar/helper/DataConverter.java | 2 +- tools/translate.py | 35 ------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 tools/translate.py diff --git a/src/org/traccar/helper/DataConverter.java b/src/org/traccar/helper/DataConverter.java index 0df0219ad..7abd4ae93 100644 --- a/src/org/traccar/helper/DataConverter.java +++ b/src/org/traccar/helper/DataConverter.java @@ -26,7 +26,7 @@ public final class DataConverter { public static byte[] parseHex(String string) { try { - return Hex.decodeHex(string.toCharArray()); + return Hex.decodeHex(string); } catch (DecoderException e) { throw new RuntimeException(e); } diff --git a/tools/translate.py b/tools/translate.py deleted file mode 100644 index e8324a61a..000000000 --- a/tools/translate.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python - -import os -import optparse -import urllib2 -import json -import base64 - -parser = optparse.OptionParser() -parser.add_option("-u", "--user", dest="username", help="transifex user login") -parser.add_option("-p", "--password", dest="password", help="transifex user password") - -(options, args) = parser.parse_args() - -if not options.username or not options.password: - parser.error('User name and password are required') - -os.chdir(os.path.dirname(os.path.abspath(__file__))) - -path = "../web/l10n/" - -def request(url): - req = urllib2.Request(url) - auth = base64.encodestring("%s:%s" % (options.username, options.password)).replace("\n", "") - req.add_header("Authorization", "Basic %s" % auth) - return urllib2.urlopen(req) - -resource = json.load(request("https://www.transifex.com/api/2/project/traccar/resource/web/?details")) - -for language in resource["available_languages"]: - code = language["code"] - data = request("https://www.transifex.com/api/2/project/traccar/resource/web/translation/" + code + "?file") - file = open(path + code + ".json", "wb") - file.write(data.read()) - file.close() -- cgit v1.2.3