Browse Source

Show ETA only if the translator is enabled

doc-issue-template
MrS0m30n3 7 years ago
parent
commit
6066a9fa30
1 changed files with 3 additions and 4 deletions
  1. 7
      devscripts/check-translation.py

7
devscripts/check-translation.py

@ -179,10 +179,6 @@ def main(args):
pinfo("Checking translations, this might take a while...") pinfo("Checking translations, this might take a while...")
eta = timedelta(seconds=len(pot_file) * WTIME)
pinfo("Approximate time to check translations online: {}".format(eta))
pot_msgid = [entry.msgid for entry in pot_file] pot_msgid = [entry.msgid for entry in pot_file]
po_msgid = [entry.msgid for entry in po_file] po_msgid = [entry.msgid for entry in po_file]
@ -201,6 +197,9 @@ def main(args):
# Init translator only if the '--no-translate' flag is NOT set # Init translator only if the '--no-translate' flag is NOT set
translator = None translator = None
if not args.no_translate: if not args.no_translate:
eta = timedelta(seconds=len(pot_file) * WTIME)
pinfo("Approximate time to check translations online: {}".format(eta))
translator = google_translate.GoogleTranslator(timeout=5.0, retries=2, wait_time=WTIME) translator = google_translate.GoogleTranslator(timeout=5.0, retries=2, wait_time=WTIME)
# Set source language for GoogleTranslator # Set source language for GoogleTranslator

Loading…
Cancel
Save