diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-18 11:42:51 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-18 11:42:51 +1200 |
commit | 23afedc36b03ab54d84b85a76dc7b248dbfb3b26 (patch) | |
tree | bc6a4f3e15e8e6046fe1d92bc1f81074199265a2 /tools/translate.py | |
parent | e3ed7e2fac9c96c6c6b49a1b9085cdb4e290f72a (diff) | |
download | trackermap-server-23afedc36b03ab54d84b85a76dc7b248dbfb3b26.tar.gz trackermap-server-23afedc36b03ab54d84b85a76dc7b248dbfb3b26.tar.bz2 trackermap-server-23afedc36b03ab54d84b85a76dc7b248dbfb3b26.zip |
Remove web interface from main repo
Diffstat (limited to 'tools/translate.py')
-rwxr-xr-x | tools/translate.py | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/tools/translate.py b/tools/translate.py deleted file mode 100755 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() |