Skip to content

Commit

Permalink
better youdao engine for alfred
Browse files Browse the repository at this point in the history
  • Loading branch information
LPX-E5BD8 committed Oct 21, 2018
1 parent 9d5ab4e commit 9302559
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engine/bing.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"io/ioutil"
"net/http"
"strings"
"os"
"strings"

"github.com/liipx/gdict/common"
)
Expand Down
10 changes: 10 additions & 0 deletions engine/youdao.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ func (yd *Youdao) WFOutput() string {
}
}

// add translations
for _, tr := range yr.Translation {
result.Items = append(result.Items, &WFItem{
Valid: true,
Title: tr,
Subtitle: tr,
Arg: tr,
})
}

resultByte, err := json.Marshal(result)
if err != nil {
os.Exit(1)
Expand Down

0 comments on commit 9302559

Please sign in to comment.