Skip to content

Commit 9302559

Browse files
committed
better youdao engine for alfred
1 parent 9d5ab4e commit 9302559

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

engine/bing.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"fmt"
66
"io/ioutil"
77
"net/http"
8-
"strings"
98
"os"
9+
"strings"
1010

1111
"github.com/liipx/gdict/common"
1212
)

engine/youdao.go

+10
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,16 @@ func (yd *Youdao) WFOutput() string {
158158
}
159159
}
160160

161+
// add translations
162+
for _, tr := range yr.Translation {
163+
result.Items = append(result.Items, &WFItem{
164+
Valid: true,
165+
Title: tr,
166+
Subtitle: tr,
167+
Arg: tr,
168+
})
169+
}
170+
161171
resultByte, err := json.Marshal(result)
162172
if err != nil {
163173
os.Exit(1)

0 commit comments

Comments
 (0)