summaryrefslogtreecommitdiff
path: root/lang/push.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-03-14 02:01:48 -0300
committerJesusaves <cpntb1@ymail.com>2018-03-14 02:01:48 -0300
commite4013edf26794c15146fbd73ec723062e5c7d6b0 (patch)
tree066a206c37adfb0990389fb99628d996ce84b2cc /lang/push.py
parent4f08d23dccb53ea0ad1704f27b47a46398fefe6d (diff)
downloadtools-e4013edf26794c15146fbd73ec723062e5c7d6b0.tar.gz
tools-e4013edf26794c15146fbd73ec723062e5c7d6b0.tar.bz2
tools-e4013edf26794c15146fbd73ec723062e5c7d6b0.tar.xz
tools-e4013edf26794c15146fbd73ec723062e5c7d6b0.zip
Fetch and Push scripts, translation updates
Diffstat (limited to 'lang/push.py')
-rwxr-xr-xlang/push.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/lang/push.py b/lang/push.py
new file mode 100755
index 0000000..536ab6e
--- /dev/null
+++ b/lang/push.py
@@ -0,0 +1,50 @@
+#! /usr/bin/env python2.7
+# -*- coding: utf8 -*-
+#
+# Copyright (C) 2018 TMW-2
+# Author: Jesusalva
+
+from transifex.api import TransifexAPI
+
+print("This script is not used. If you're sure you want to use it comment line 10.")
+exit(1)
+
+project='saulc-tmw-fork'
+
+# Load credentials from login.txt and password.txt
+login=open('login.txt', 'r')
+for i in login:
+ username=i.replace('\n', '').replace('\r', '')
+
+login.close()
+
+passw=open('password.txt', 'r')
+for i in passw:
+ password=i.replace('\n', '').replace('\r', '')
+
+passw.close()
+
+t=TransifexAPI(username, password, 'https://www.transifex.com')
+
+if (not t.ping):
+ print("ERROR: Ping failed, this may be due incorrect username/password in login.txt and password.txt. Ensure there is NO newline at the end of file.")
+ exit(1)
+
+if (not t.project_exists(project)):
+ print("ERROR: Invalid project name")
+ exit(1)
+
+# Load languages
+langs=[]
+vcx=open("../../server-data/langs/langs.txt", "r")
+for i in vcx:
+ if i != "en":
+ langs.append(i.replace('\n', ''))
+vcx.close()
+
+# Send all translations (en.pot must be sent already!)
+for i in langs:
+ print("Uploading %s..." %(i))
+ #t.new_translation(project, 'server-data', i, 'out/'+str(i)+'.po')
+
+