Let Travis upload templates to crowdin

This commit is contained in:
Johann Bauer 2017-05-18 21:04:09 +02:00
parent 4cfa513ff1
commit a6f9e41d6a
2 changed files with 6 additions and 0 deletions

View File

@ -6,3 +6,5 @@ install:
- pip install tox
script:
- tox
after_success:
- if [ "$TRAVIS_BRANCH" = "master" ]; then pip install pycurl requests && contrib/make_locale; fi

View File

@ -19,8 +19,12 @@ crowdin_identifier = 'electrum'
crowdin_file_name = 'electrum-client/messages.pot'
locale_file_name = 'locale/messages.pot'
crowdin_api_key = None
if os.path.exists('../contrib/crowdin_api_key.txt'):
crowdin_api_key = open('../contrib/crowdin_api_key.txt').read().strip()
if "crowdin_api_key" in os.environ:
crowdin_api_key = os.environ["crowdin_api_key"]
if crowdin_api_key:
# Push to Crowdin
print 'Push to Crowdin'
url = ('https://api.crowdin.com/api/project/' + crowdin_identifier + '/update-file?key=' + crowdin_api_key)