Skip to content

Commit

Permalink
Merge pull request #2259 from mhsmith/master
Browse files Browse the repository at this point in the history
Make make_locale check exit status of gettext commands
  • Loading branch information
cculianu committed May 22, 2021
2 parents 7ca9066 + a64a434 commit f61b6d3
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions contrib/make_locale
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
#!/usr/bin/env python3

import glob
import io
import itertools
import os
from os.path import isdir, join
from pathlib import Path
import requests
import shlex
from subprocess import check_call
import sys
import io
import zipfile
import requests
import glob
import itertools
from pathlib import Path

assert len(sys.argv) < 3

def run(cmd):
check_call(shlex.split(cmd))

original_dir = os.getcwd()
os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chdir('..')
Expand Down Expand Up @@ -45,7 +51,7 @@ if not os.path.exists('electroncash/locale'):
os.mkdir('electroncash/locale')
cmd = 'xgettext -s --from-code UTF-8 --language Python --no-wrap -f app.fil --keyword=pgettext:1c,2 --keyword=npgettext:1c,2,3 -c --output=electroncash/locale/messages.pot'
print('Generate template')
os.system(cmd)
run(cmd)

os.chdir('electroncash')

Expand Down Expand Up @@ -102,4 +108,4 @@ for lang in os.listdir('locale'):
os.mkdir(msg_dir)
cmd = 'msgfmt --output-file="{0}/electron-cash.mo" "{0}/electron-cash.po"'.format(msg_dir)
print('Installing', lang)
os.system(cmd)
run(cmd)

0 comments on commit f61b6d3

Please sign in to comment.