mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 07:51:27 +00:00
Fix crowdin upload
This commit is contained in:
parent
c3e26a1e2b
commit
79edd2dbf1
1 changed files with 7 additions and 6 deletions
|
@ -28,11 +28,11 @@ os.system(cmd)
|
|||
os.chdir('lib')
|
||||
|
||||
crowdin_identifier = 'electrum'
|
||||
crowdin_file_name = 'electrum-client/messages.pot'
|
||||
crowdin_file_name = 'files[electrum-client/messages.pot]'
|
||||
locale_file_name = 'locale/messages.pot'
|
||||
crowdin_api_key = None
|
||||
|
||||
filename = '~/.crowdin_api_key'
|
||||
filename = os.path.expanduser('~/.crowdin_api_key')
|
||||
if os.path.exists(filename):
|
||||
with open(filename) as f:
|
||||
crowdin_api_key = f.read().strip()
|
||||
|
@ -44,13 +44,14 @@ 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)
|
||||
with open(locale_file_name,'rb') as f:
|
||||
with open(locale_file_name, 'rb') as f:
|
||||
files = {crowdin_file_name: f}
|
||||
requests.request('POST', url, files=files)
|
||||
response = requests.request('POST', url, files=files)
|
||||
print("", "update-file:", "-"*20, response.text, "-"*20, sep="\n")
|
||||
# Build translations
|
||||
print('Build translations')
|
||||
response = requests.request('GET', 'https://api.crowdin.com/api/project/' + crowdin_identifier + '/export?key=' + crowdin_api_key).content
|
||||
print(response)
|
||||
response = requests.request('GET', 'https://api.crowdin.com/api/project/' + crowdin_identifier + '/export?key=' + crowdin_api_key)
|
||||
print("", "export:", "-" * 20, response.text, "-" * 20, sep="\n")
|
||||
|
||||
# Download & unzip
|
||||
print('Download translations')
|
||||
|
|
Loading…
Add table
Reference in a new issue