From 90d47f1a16eec1547850a50f5e78572a772ec65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Sun, 13 Oct 2019 18:11:29 +0200 Subject: [PATCH] Use new API in main.go --- main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index c8ea35b..1eec795 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,6 @@ import ( "os" "strings" "./trans" - "./identify" "github.com/deanishe/awgo" "regexp" ) @@ -26,7 +25,9 @@ func run() { fromLang, toLang = decideWhatLanguagesToUse(word) } - translations := trans.New(word, fromLang, toLang).Translate() + t := trans.New(word) + t.Language = fromLang + translations := t.Translate(toLang) for _, translation := range translations { wf.NewItem(translation).Arg(translation).Valid(true) } @@ -58,7 +59,7 @@ func isTransLanguageSpecifier(arg string) bool { } func decideWhatLanguagesToUse(word string) (string, string) { - fromLang := identify.New(word).Identify() + fromLang := trans.New(word).Identify() toLang := map[string]string{ "en": "hu", "hu": "en",