fix string formats that are ambiguous for translators

This commit is contained in:
Hans-Christoph Steiner 2017-09-15 23:20:29 +02:00
parent 255932453c
commit 6c7b987239
10 changed files with 106 additions and 85 deletions

View file

@ -62,21 +62,24 @@ def extract(config, options):
try:
if os.path.isfile(apk):
sigdir = extract_signature(apk)
logging.info(_('fetched signatures for %s -> %s'), apk, sigdir)
logging.info(_("Fetched signatures for '{apkfilename}' -> '{sigdir}'")
.format(apkfilename=apk, sigdir=sigdir))
elif httpre.match(apk):
if apk.startswith('https') or options.no_check_https:
try:
tmp_apk = os.path.join(tmp_dir, 'signed.apk')
net.download_file(apk, tmp_apk)
sigdir = extract_signature(tmp_apk)
logging.info(_('fetched signatures for %s -> %s'), apk, sigdir)
logging.info(_("Fetched signatures for '{apkfilename}' -> '{sigdir}'")
.format(apkfilename=apk, sigdir=sigdir))
finally:
if tmp_apk and os.path.exists(tmp_apk):
os.remove(tmp_apk)
else:
logging.warn(_('refuse downloading via insecure http connection (use https or specify --no-https-check): %s'), apk)
logging.warn(_('refuse downloading via insecure http connection (use https or specify --no-https-check): {apkfilename}').format(apkfilename=apk))
except FDroidException as e:
logging.warning(_("failed fetching signatures for '%s': %s"), apk, e)
logging.warning(_("Failed fetching signatures for '{apkfilename}': {error}")
.format(apkfilename=apk, error=e))
if e.detail:
logging.debug(e.detail)