Use new API in main.go
This commit is contained in:
parent
a34e948a57
commit
90d47f1a16
7
main.go
7
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",
|
||||
|
Loading…
Reference in New Issue
Block a user