From 1ef41a3d6d2b4a0fd86174be3617e4ad2889fd46 Mon Sep 17 00:00:00 2001 From: Deven Blake Date: Thu, 6 Jan 2022 08:20:54 -0500 Subject: [PATCH] works multiline now --- dotfiles-old/bin/translate | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dotfiles-old/bin/translate b/dotfiles-old/bin/translate index 8d2ceab..46e173f 100755 --- a/dotfiles-old/bin/translate +++ b/dotfiles-old/bin/translate @@ -64,11 +64,9 @@ def main(argc, argv): except KeyboardInterrupt: fprintf(stderr, "%s: Cancelled (keyboard interrupt).\n", argv[0]); exit(1); - if len(text) == 1: - text = text[0]; - translated = translator.translate(text, src=src, dest=dest); - if not(type(translated) is list): translated = [ translated ]; - for translation in translated: + for i in range(len(text)): + text[i] = translator.translate(text[i], src=src, dest=dest); + for translation in text: if isatty: fprintf(stdout, "%s -> %s\n"