Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdcv failed to work on Ubuntu 20.04. #21

Closed
hongyi-zhao opened this issue Jul 24, 2021 · 9 comments
Closed

sdcv failed to work on Ubuntu 20.04. #21

hongyi-zhao opened this issue Jul 24, 2021 · 9 comments

Comments

@hongyi-zhao
Copy link

On Ubuntu 20.04, I installed the latest sdcv and added some dictionaries as shown below:

werner@X10DAi:~$ sdcv -v
Console version of Stardict, version 0.5.3
werner@X10DAi:~$ sdcv -l
Dictionary's name   Word count
懒虫简明英汉词典    452185
Webster's Third New International Dictionary, Unabridged (En-En)    296190

The Emacs configuration for sdcv is as follows:

(use-package sdcv
  :demand t
  :straight (:host github :repo "manateelazycat/sdcv")
  :config
  ;https://github.com/manateelazycat/sdcv#configuration
  (setq ;sdcv-say-word-p t        ;say word after translation
        sdcv-dictionary-data-dir "~/.stardict/dic" ;setup directory of stardict dictionary
        sdcv-dictionary-simple-list    ;setup dictionary list for simple search
        '("Webster's Third New International Dictionary, Unabridged (En-En)"
          "懒虫简明英汉词典"
          )

        sdcv-dictionary-complete-list ;setup dictionary list for complete search
        '("Webster's Third New International Dictionary, Unabridged (En-En)"
          "懒虫简明英汉词典"
        )))

With the point on a word, say, "you", I issue the command `M-x sdcv-search-point RET', but nothing returned:

image

Any hints for this problem?

Regards,
HY

@ghost
Copy link

ghost commented Jul 26, 2021

Try M-x sdcv-check, the dictionary name might be wrong.

@hongyi-zhao
Copy link
Author

Try M-x sdcv-check, the dictionary name might be wrong.

The dictionary’s settings look correct, sdcv should work as expected.

And emacs-sdcv works smoothly using the same dictionaries setting with the following configuration:

(use-package sdcv-mode
  :demand t
  :straight (:host github :repo "gucong/emacs-sdcv")
  :config
  (setq sdcv-dictionary-list 
        '("Webster's Third New International Dictionary, Unabridged (En-En)"
          "懒虫简明英汉词典")))

image

But emacs-sdcv can only return the query results from the first dictionary. I still can't figure out the fix.

@manateelazycat
Copy link
Owner

Please use sdcv-check, and read message of sdcv-check.

@hongyi-zhao
Copy link
Author

image

image

@ghost
Copy link

ghost commented Aug 8, 2021

@hongyi-zhao This is wired... But I believe that sdcv.el need a explicite require to work, dose the :ensure keyword provided by use-package guarantee this ? If not, try replace the :ensure t statement with :init (require 'sdcv)

@hongyi-zhao
Copy link
Author

No, all the above tricks can't fix the problem. But sdcv.el works smoothly with the following configuration:

;https://github.com/stardiviner/sdcv.el
(use-package showtip)
(use-package sdcv
  :demand t
  :straight (stardiviner-sdcv\.el :local-repo "stardiviner-sdcv.el" :host github :repo "stardiviner/sdcv.el")
  :config
  (setq ; This version doesn't have the following options:
        ;sdcv-say-word-p t        ;say word after translation
        ;sdcv-dictionary-data-dir "~/.stardict/dic" ;setup directory of stardict dictionary
       
        ; Below are the valid options:
        ; sdcv-dictionary-simple-list    ;setup dictionary list for simple search
        ; '("Webster's Third New International Dictionary, Unabridged (En-En)"
        ;   "懒虫简明英汉词典")

        ;The query results are returned in the reverse order of the dictionaries that appear in the list.
        sdcv-dictionary-complete-list ;setup dictionary list for complete search
        (nreverse '("Webster's Third New International Dictionary, Unabridged (En-En)"
                    "Oxford English Dictionary 2nd Ed. P1"
                    "Oxford English Dictionary 2nd Ed. P2")))
  :bind
  ("C-x s" . sdcv-search-pointer))

@Mercurius-Lee
Copy link

No, all the above tricks can't fix the problem. But sdcv.el works smoothly with the following configuration:

;https://github.com/stardiviner/sdcv.el
(use-package showtip)
(use-package sdcv
  :demand t
  :straight (stardiviner-sdcv\.el :local-repo "stardiviner-sdcv.el" :host github :repo "stardiviner/sdcv.el")
  :config
  (setq ; This version doesn't have the following options:
        ;sdcv-say-word-p t        ;say word after translation
        ;sdcv-dictionary-data-dir "~/.stardict/dic" ;setup directory of stardict dictionary
       
        ; Below are the valid options:
        ; sdcv-dictionary-simple-list    ;setup dictionary list for simple search
        ; '("Webster's Third New International Dictionary, Unabridged (En-En)"
        ;   "懒虫简明英汉词典")

        ;The query results are returned in the reverse order of the dictionaries that appear in the list.
        sdcv-dictionary-complete-list ;setup dictionary list for complete search
        (nreverse '("Webster's Third New International Dictionary, Unabridged (En-En)"
                    "Oxford English Dictionary 2nd Ed. P1"
                    "Oxford English Dictionary 2nd Ed. P2")))
  :bind
  ("C-x s" . sdcv-search-pointer))

I also guessed that the " sdcv-check " function had a bug ,
since I used the stardiviner repo without the sdcv-check and
it looks well.

@X-Shine
Copy link

X-Shine commented Sep 13, 2021

@hongyi-zhao hello! I met the same problem today and my config is simliar to yours. Then I replace ~ to my absolute home path and it works. Do you replace ~ with your absolute home path? Sorry for my poor english.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Sep 13, 2021

You're right. The following configuration works:

sdcv-dictionary-data-dir (expand-file-name "~/.stardict/dic")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants