為Mac的自帶的詞典添加自定義詞庫


1.准備詞庫mdx、css文件

2.安裝Dictionary Development Kit

https://github.com/SebastianSzturo/Dictionary-Development-Kit

安裝后目錄結構如下:

/Applications/Utilities/Dictionary\ Development\ Kit
├── README.md
├── bin
├── documents
├── project_templates
└── samples

3.下載pyglossary

https://github.com/ilius/pyglossary

4. 安裝詞典

cd $pyglossary-path
python3 $pyglossary-path/main.py --write-format=AppleDict dict.mdx $directory-name
cd $directory-name

復制詞典原來附隨的css樣式,粘貼到$directory-name下的css文件中.
.plist文件第10行更改的CFBundleDisplayName值,這將會是是詞庫在詞典顯示的名字

make && make install

詞典將會安裝到~/Library/Dictionaries目錄

5.最后

重啟詞典應用,在詞典的偏好設置里添加自定義詞典


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM