mac-dictionary-kit
mac-dictionary-kit copied to clipboard
fix crashing on Catalina
ENV: Xcode 11.3.1 (11C504) Catalina 10.15.3 (19D76)
For unkown reason, [pboard propertyListForType: NSPasteboardTypeFileURL] returns an NSString(NSCFString) directly instead of an NSArray.
it cause DictUnifier can't get correct file url.
It can not open dict file.
Step 1
brew install glib
Step 2
Run xcode
![2020-02-07 1 40 07](https://user-images.githubusercontent.com/32381827/74004115-d2070000-49af-11ea-8dda-91c6315a7d4e.png)
you can use it by dragging a dictionary data file.tar.bz2
into the app window.
Menu -> FIle -> Open...
not clickable seems to be another bug from original master branch?🤔
Drag operation is invalid.
It seems to be another bug.
Alternative: You can release the latest compiled version.
there is a chance that the operation will fail, the reason is because this application has two DragAndDrop callbacks, which are located in DUWindow and DUImageView, i just only fix bug in DUWindow, missed in DUImageView.
need test in previous macOS version
Well!!! It is work.
But Menu -> FIle -> Open...
not clickable.
DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.
@daimon99 Hello,My MacBook Pro are Catalina 10.15.3 as yours, and downloaded your release of DictUnifier, the crash problem in drawing file was solved. However, a new error is any tar.bz2 file was failed to convert and the software give up for converting.
@KingofAsianPopJC I noticed in use that some dictionary files fail to convert, try other ones http://download.huzheng.org/zh_CN/
maybe we should create another branch pull request to fix this convert-failed problem. current pull request focused on fixing file open crash issue.
@shincurry Thanks for your reply! I downloaded 8 dictionary from http://download.huzheng.org/zh_CN/, but all of them failed to be converted and all of them were English-Chinese dictionarys. Other dictionaries in this website are not suitable for me in use.
![截屏2020-02-13下午12 21 52](https://user-images.githubusercontent.com/4946624/74401809-5dbfd700-4e5d-11ea-8a4e-1eef8299a47e.png)
i have converted 4 dictionaries successfully.
@KingofAsianPopJC
![]()
i have converted 4 dictionaries successfully.
@KingofAsianPopJC
您好,請問一下是否能提供「计算机词汇 」的文件呢? 本身沒有任何程式編寫經驗,因看了您的文章後成功修復了DictUnifier的bug,謝謝您!
@KingofAsianPopJC Try to install glib with this commande brew install glib
I got the same problem after installing glib, it works
Using this fix I have successfully converted Collins COBUILD Advanced Learner's Dictionary 2006 from http://download.huzheng.org/dict.org/ . However, query a word will result a "Format not supported" error message in Dictionary app.
macOS version is 10.15.2.
Good job, mate. It is really helpful :)
DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.
that works for me,thanks
@KingofAsianPopJC Try to install glib with this commande
brew install glib
I got the same problem after installing glib, it works
@qfdk I input "brew install glib" in the terminal, but it says "command not found".
@RigelXi You need to install brew with this command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Then you can use brew command to install glib
Using this fix I have successfully converted Collins COBUILD Advanced Learner's Dictionary 2006 from http://download.huzheng.org/dict.org/ . However, query a word will result a "Format not supported" error message in Dictionary app.
macOS version is 10.15.2.
I have the same problem with the Merriam-Webster's Collegiate Dictionary in http://download.huzheng.org/bigdict/ Anyone has fix for this "Format not supported" issue?
Using this fix I have successfully converted Collins COBUILD Advanced Learner's Dictionary 2006 from http://download.huzheng.org/dict.org/ . However, query a word will result a "Format not supported" error message in Dictionary app.
macOS version is 10.15.2.
I have the same problem with the Merriam-Webster's Collegiate Dictionary in http://download.huzheng.org/bigdict/ Anyone has fix for this "Format not supported" issue?
朗道英汉词典5.0 works me,but Merriam Webster's Collegiate Dictionaries in "http://download.huzheng.org/bigdict/" and in "http://download.huzheng.org/babylon/english/" both show "Format not supported" error message in dictionary app, as @rainux commented.
@xiao-zang I read the codes these days and found that some formats had never been supported by the author. https://github.com/jjgod/mac-dictionary-kit/blob/2b8705d76b53c8a7ea21bc629d9a66d1170cb173/sdconv/convert.cpp#L94-L100
Considering the latest commit was about 2 years ago, I believe this repo is no more maintained. So the answer is: No fix.
@xiao-zang I read the codes these days and found that some formats had never been supported by the author.
https://github.com/jjgod/mac-dictionary-kit/blob/2b8705d76b53c8a7ea21bc629d9a66d1170cb173/sdconv/convert.cpp#L94-L100
Considering the latest commit was about 2 years ago, I believe this repo is no more maintained. So the answer is: No fix.
Thank you for the quick comment! @ritou11 It is disappointing though, as I feel Merriam-Webster has the most comprehensive definitions for some words. For example, if you look up "overhang" in https://www.merriam-webster.com/dictionary/overhang, the 4th definition of the noun is not listed in almost any other dictionary.
@xiao-zang Maybe you could try my repo dictconv these days. It's built using Node.js based on this repo, but supports type 'h'. Note that dictconv
is the very early version and you could provide the link to your stardict by issues if it doesn't work.
@xiao-zang Maybe you could try my repo dictconv these days. It's built using Node.js based on this repo, but supports type 'h'. Note that
dictconv
is the very early version and you could provide the link to your stardict by issues if it doesn't work.
@ritou11 Your dictconv converted http://download.huzheng.org/bigdict/stardict-Merriam-Webster_s_Collegiate_11th_Ed-2.4.2.tar.bz2 successfully, but the resulting dictionary looks like this
![image](https://user-images.githubusercontent.com/25338528/80658656-b4987e00-8a54-11ea-8a5b-6b676f6cfe2d.png)
But thank you anyway!
依然不行🥺试了三个词典。请问有新的办法了吗?Open files依然无法点按……
I believe you can fix the crash by replacing NSPasteboardTypeFileURL
with NSFilenamesPboardType
without other changes.
DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.
@daimon99 This one didn't work at first, as it returned "abort" when dragging a stardict into it. The "Open" button was invalid, too.
But after I installed glib using brew install glib
, the drag operation works. Though the "Open" button remains invalid.
I converted a roughly-8M Oxford English-Chinese dictionary on macOS Catalina 10.15.6 and it cost me about over 12 hours and still not finished, is this normal?
I converted a roughly-8M Oxford English-Chinese dictionary on macOS Catalina 10.15.6 and it cost me about over 12 hours and still not finished, is this normal?
@lzw429 obviously abnormal.
There are still some bugs in this application that have not been fixed. Currently, only some dictionary files can be converted normally.
In Catalina (10.15.6), I'm getting this when loading it with a dictionary file[1]:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSConcreteTask terminationStatus]: task not launched' abort() called terminating with uncaught exception of type NSException
[1] The file stardict-dictd-web1913-2.4.2.tar.bz2
available at https://s3.amazonaws.com/jsomers/dictionary.zip referenced from https://jsomers.net/blog/dictionary
It worked with the build from @daimon99 ! Thanks. I hope that build can make it into the releases section, @jjgod .
Actually.. It always just stopped at "Checking source"...
After running brew install glib
(installing glib properly; i.e. completely without errors) then DictUnifier always just stops at Building dictd_www.dict.org_web1913.dictionary.
(the latter part is the name of the dictionary).
I was able to use @daimon99's build of DictUnifier to successfully convert/install the following dictionary, like @chiaaaa96 also managed: stardict-cedict-gb-2.4.2.tar.bz2. So it seems like it might be some incompatibilities with certain dictionaries, like stardict-dictd-web1913-2.4.2.tar.bz2 which makes them unable to be built.
This note from a fork of this repo could give a clue as to why some dictionaries won't build:
"The source dictionary could be in any format, but we only support stardict format at present. The target dictionary must be Dictionary 2.0 format defined in Mac OS X 10.5.". (I am using Dictionary 2.3.0 (239.5)
in MacOS Catalina.)
Was able to install Webster's 1913 dictionary in MacOS Catalina using the precompiled websters-1913.dictionary.zip from https://github.com/ponychicken/WebsterParser. Circumventing the need to use DictUnifier.
For other dictionaries, the build instructions here: https://github.com/ponychicken/WebsterParser and the instructions in this StackExchange answer, might help tech savvy users, for dictionaries where DictUnifier fails to work.
@daimon99 Hello,My MacBook Pro are Catalina 10.15.3 as yours, and downloaded your release of DictUnifier, the crash problem in drawing file was solved. However, a new error is any tar.bz2 file was failed to convert and the software give up for converting.
hi~, there is a solution about this.
open your terminal and install brew, so you can install glib
brew install glib
just wait for a minute and then you can drop tar.bz2 file to DictUnifier!
Any upcoming plans for Big Sur support?
Is it crashing on Apple Silicon? I can't use it on my M1 MacBook with Catalina build version
DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.
@daimon99 This one didn't work at first, as it returned "abort" when dragging a stardict into it. The "Open" button was invalid, too.
But after I installed glib using
brew install glib
, the drag operation works. Though the "Open" button remains invalid.
not work now in Catalia 10.15.5
DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.
It's working on Big Sur 11.5.1. Make sure glib is installed!
DictUnifier.zip The release of Catalina build version. It is ok with my mac Catalina 10.15.3 (19D76) version.
my macOS is 11.5, it is works for me when i execute
brew glib
tips:
you may execute
brew update
brew upgrade
first
@xiao-zang Maybe you could try my repo dictconv these days. It's built using Node.js based on this repo, but supports type 'h'. Note that
dictconv
is the very early version and you could provide the link to your stardict by issues if it doesn't work.
I have tried dictconv
and it works for me. thanks