From 2255dd3fd57f46b77255a67d85f339014dfa8833 Mon Sep 17 00:00:00 2001 From: teddy Date: Sun, 22 Sep 2024 04:44:12 +0200 Subject: [PATCH] fix(deepl) : check target lang in interactive mode --- service/translate.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/translate.go b/service/translate.go index 96105a3..7a11b97 100644 --- a/service/translate.go +++ b/service/translate.go @@ -43,16 +43,16 @@ func TranslateInteractiveMode() error { translateSdk := sdk.GetSdkTranslate() l := lang.GetLocalize() + if translateSdk.GetTargetLang() == "" { + return errors.New(l.Get("translate-target-required")) + } + for { input := utils.Input(l.Get("translate-input"), "", false) if input == "exit" { break } - if translateSdk.GetTargetLang() == "" { - return errors.New(l.Get("translate-target-required")) - } - resp, err := translateSdk.SendRequest(input) if err != nil { return err