Skip to content

Commit

Permalink
fix(deepl) : check target lang in interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
LordPax committed Sep 22, 2024
1 parent ecb6cee commit 2255dd3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions service/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2255dd3

Please sign in to comment.