From a6f9e41d6afdb0acda9fc6c3dc03cf3ce29635b3 Mon Sep 17 00:00:00 2001 From: Johann Bauer Date: Thu, 18 May 2017 21:04:09 +0200 Subject: [PATCH] Let Travis upload templates to crowdin --- .travis.yml | 2 ++ contrib/make_locale | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index e295adab6..e7608ffb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/contrib/make_locale b/contrib/make_locale index ea453798d..8393d4275 100755 --- a/contrib/make_locale +++ b/contrib/make_locale @@ -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)