From c517801c5f38866cbe89a9dffec2c6130b2bcd45 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 18 Jan 2021 18:51:10 +1100 Subject: [PATCH] Update doc strings for translation scripts --- InvenTree/script/translate.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/InvenTree/script/translate.py b/InvenTree/script/translate.py index 407acb93c8..3a08c0b410 100644 --- a/InvenTree/script/translate.py +++ b/InvenTree/script/translate.py @@ -28,8 +28,10 @@ def manually_translate_file(filename, save=False): print("For each missing translation:") print("a) Directly enter a new tranlation in the target language") print("b) Leave empty to skip") + print("c) Press Ctrl+C to exit") - input("Press to continue") + print("-------------------------") + input("Press to start") print("") with open(filename, 'r') as f: @@ -58,7 +60,10 @@ def manually_translate_file(filename, save=False): print("Source:", source_line) print("Enter translation for {t}".format(t=msgid)) - translation = str(input(">")) + try: + translation = str(input(">")) + except KeyboardInterrupt: + break if translation and len(translation) > 0: # Update the line with the new translation @@ -71,7 +76,7 @@ def manually_translate_file(filename, save=False): output_file.writelines(out) print("Translation done: written to", filename) - print("Run 'make translate' to rebuild translation data") + print("Run 'invoke translate' to rebuild translation data") if __name__ == '__main__':