From 6066a9fa30cea9b6e9036ef76f0a8fd6c9ac0511 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Fri, 15 Dec 2017 15:30:32 +0200 Subject: [PATCH] Show ETA only if the translator is enabled --- devscripts/check-translation.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/devscripts/check-translation.py b/devscripts/check-translation.py index 2488d4c..c313ac2 100644 --- a/devscripts/check-translation.py +++ b/devscripts/check-translation.py @@ -179,10 +179,6 @@ def main(args): 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] 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 translator = None 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) # Set source language for GoogleTranslator