15

For quite a while now, I have been looking for English and Spanish conversion dictionaries (both ways) for Apple's native Dictionary application. So far I have not had any success.

Is there any free, decent quality solution such as "New Oxford American Dictionary" and "Dictionnaire de l'Académie Française"?

Any links or information would be highly appreciated.

1
  • Despite of what the FAQ might say, Toms answer is acceptable and within my phrased request. thank you!
    – v2r
    Feb 27, 2012 at 18:05

4 Answers 4

17

The latest MacOS versions already include Spanish dictionaries which can be enabled in preferences in the Dictionary.app (+,).

The answer below is for converting and installing third-party dictionaries from other popular formats.

To create a dictionary for the built-in OS X Dictionary.app you will first need pyglossary to convert to the AppleDict format from the input format which can be ABBYY Lingvo DSL, Babylon BGL, Stardict IFO, etc (see all supported formats).

Once the AppleDict source XML is generated, the Apple Dictionary Development Kit is used to generate the native binary files that the Dictionary.app can use.

Proceed as follows:

Installing dependencies

  1. Install Xcode command line tools:

     xcode-select --install
    
  2. Install the Additional Tools for Xcode from https://developer.apple.com/download/ (search with 🔎 )— you'll need to login with your iCloud or Apple Developer account. Mount the DMG file by double-clicking it in Finder, and copy the folder Dictionary Development Kit to /Developer/Extras (as root) (or to ~/Developer/Extras as a normal user as pointed out by richard-möhn):

     mkdir -p ~/Developer/Extras/
     cp -r '/Volumes/Additional Tools/Utilities/' ~/Developer/Extras
    
  3. Install Python 3 via homebrew (OS X comes with Python 2.x preinstalled):

     brew install python3
    
  4. Checkout the pyglossary project:

     mkdir -p ~/projects
     git clone --depth 1 https://github.com/ilius/pyglossary.git ~/projects/pyglossary
    
  5. Install lxml and BeautifulSoup, the parsers that pyglossary depends on:

     pip3 install lxml beautifulsoup4
    

Now everything is ready to do the actual conversion.

Performing the Conversion

  1. Convert the source dictionary (in this case Babylon BGL) to AppleDict:

     python3 pyglossary.pyw --read-options=resPath=OtherResources --write-format=AppleDict webster.bgl webster.xml
    

NOTE: This operation can take significant time if the dictionary is big.

  1. Compile the generated AppleDict sources to OS X Dictionary.app binary files. Pyglossary creates the AppleDict sources in a subfolder named the same as the source file.

OPTIONAL: By default the dictionary name will be derived from the file name of the input file. If you want to modify the name to something else then open Makefile in a text editor, and set the title in the DICT_NAME variable (make sure you include the quotes).

    cd webster ### subdir name is derived from the source file
    make
    make install

NOTE: make can take significant time if the dictionary is big. For huge dictionaries it can take over 10 minutes.

make install copies the generated dictionary to ~/Library/Dictionaries. Now if you restart the dictionary app and and open preferences (+,) the new dictionary will appear in the list. Click the checkbox to enable it.

Other formats, for example ABBYY Lingvo DSL require more steps such as re-encoding from UTF-16 to UTF-8. Here is a wrapper script for DSL to AppleDict conversion.

Here are some Free dictionaries in Babylon BGL format. There are also literally hundreds of dictionaries available in DICTD, Stardict and ABBYY Lingvo DSL formats.

See also:

3
  • Hi ccpizza, thank you very much for your answer, which is applicable, since i made it work like this in a similar case, using my linux distribution of choice, a few month back. For OSX it works as well!
    – v2r
    Jan 30, 2014 at 17:59
  • 1
    I have switched from .rst to .md. Simply opening the project in your browser will show you the RAEDME file: github.com/ilius/pyglossary
    – saeedgnu
    Oct 16, 2015 at 1:39
  • 1
    sudo is not necessary for adding the Auxiliary Tools for Xcode if you put them in ~/Developer/Extras. Jun 7, 2020 at 7:03
3

Look at this link: clasqm's virtual home. Here you can find the requested "eng-esp / esp-eng" dictionaries.

0
2

As a follow-up to ccpizza's answer, here's what you need as of today:

  • Auxiliary Tools for Xcode: http://developer.apple.com/downloads
    You need an Apple Developer account to get that.
    Once you downloaded it, you can just create a new folder at /Developer/Extras and copy the Dictionary Development Kit folder from the Auxiliary Tools there.
  • Python. This might be preinstalled.
  • beautifulsoup. Fire up a Terminal and launch this command:
    sudo easy_install beautifulsoup4
  • pyglossary: https://github.com/ilius/pyglossary

Now you can download a dictionary in any format pyglossary can read. All English - X Babylon dictionaries are here: http://www.babylon.com/free-dictionaries/languages/english

Now do what ccpizza said. I had to change the command a bit to

python pyglossary.pyw --read-options=resPath=OtherResources --write-format=AppleDict webster.bgl webster.xml
make
make install

Note that the output name (in this case "webster") will be the dictionaries name in Dictionary.app's toolbar; I used Spanish.xml for the Spanish dictionary. The last command will automatically install the dictionary file, so you can then enable it in Dictionary.app's preferences.

3
  • Thank you as well Alex, for the additional information. Much appreciated!!
    – v2r
    Jan 30, 2014 at 18:00
  • @Alex: i didn't include the dependencies into the answer because they are listed in the Readme files that come with pyglossary and Apple auxiliary tools, but it's good to have them here. Btw, the actual URL Aux package is developer.apple.com/downloads. I think that installing Command line tools for Xcode is also required, but cannot say for sure. There is also a Readme in the Dictionary Development Kit folder - it has the up-to-date instructions about compiling and folder locations, which is useful since Apple changed a bit the directory structure in the latest OSX versions.
    – ccpizza
    Jan 31, 2014 at 18:46
  • Oops. I didn't notice that in the README file, I used compiler warnings to find out what I was missing :/ ^^ It did take me a while to find the free Babylon dictionaries for download, so that was another part of the reason for this post. - Also, thanks for correcting my Apple Developer link :)
    – Alex Wally
    Feb 6, 2014 at 9:48
1

Starting with at least El Capitan, Apple provides one of these:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .