31

The reason is trivial: I am a fan of the "Word of the Day" screen saver and I would like to add dictionaries for languages other than English and Japanese (these are the two that I can select now in screen saver options).

How can I do it?

2
  • 1
    Any luck? It seems to make absolutely no sense at all that only English and Japanese dictionaries can be selected but I've found no way around it.
    – xji
    Apr 16, 2015 at 10:13
  • 1
    Seems like a half-assed project/easter egg abandoned after OS X 10.8.
    – xji
    Apr 16, 2015 at 10:20

4 Answers 4

16

On a rather obscure comment thread, someone explained where you might find the word list that Apple uses to power the screensaver. It is at /System/Library/Graphics/Quartz\ Composer\ Plug-Ins/WOTD.plugin/Contents/Resources/NOAD_wotd_list.txt. The file looks like this:

m_en_us1282510  quinsy
m_en_us1273791  orbicular
m_en_us1220945  alimony
m_en_us1250517  genome

It is a list of tab-separated entries. On the right you have the word, and on the left, what looks like an ID. But what's it an ID for, and how would you be able to find it for another word not already on the list?

As you might expect, the ID refers to an entry in Apple's default dictionary, the "New Oxford American Dictionary". (That's what "NOAD" stands for in the word-list path above.)

How to find the IDs for other words?

A fellow named Joseph Gentle, in a series of blog posts, shows how to get at the data underlying Apple's dictionaries. In his "Apple dictionaries, part 2" post, he points to code that unpacks the relevant binary file (stored in /Library/Dictionaries) into XML. Using the dedict.c and strip.c files found here, and following Gentle's example, I used the following bash commands to get at the NOAD's XML (these commands are run from the directory where you downloaded the dedict.c and strip.c files):

clang dedict.c -Wall -lz -o dedict
clang strip.c -Wall -lz -o strip
./dedict "New Oxford American Dictionary" | ./strip > dict.xml

When I head-ed the first few lines of the dict.xml file, I saw something promising, with entries that looked like this:

<d:entry xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng" id="m_en_us1219333" d:title="abode" class="entry">

Notice that id param... it's an identifier that looks exactly like the one in the screensaver word list!

I wrote the following Ruby script to parse the XML, and then, using my own word list, create a new screensaver file that maps my own words to their IDs in the dictionary:

raw = File.open("./dict.xml").read
my_words = File.open("./word_list.csv").readlines.map { |line| line.split(',')[1] }

word_id_map = {}

raw.scan(/<d:entry .*? id="(.*?)" d:title="(.*?)" class="entry">/).each do |entry|
   word_id_map[entry[1]] = entry[0]
end

my_words.each do |word|
  if id = word_id_map[word]
    puts [id, word].join('  ')
  end
end

When I replaced the original screensaver file with this new one, it worked. You can now have a "Word of the Day" screensaver that gives definitions for the words you choose.

9

If you have 10.8, you can enable French, German, Simplified Chinese, and Spanish dictionaries from the preferences of Dictionary.app:

They don't seem to be shown as choices for the Word of the Day screensaver though:

I also tried restarting after enabling the dictionaries.

2
  • 4
    Yes they don't appear in the screensaver, exactly.
    – scrrr
    Jun 27, 2013 at 12:08
  • 9
    No idea why this post got so many upvotes- Didn't solve the question at all :(
    – xji
    Apr 16, 2015 at 10:14
2

In case anyone is still interested in this in 2018 and come across this..

I just updated to OS X Mojave, and found a Word of the Day.saver file at /System/Library/Screen Savers/. In this package, go to Contents/Resources/WordLists/, and you can find the 5 .plist files used in the Mojave WotD (they added three Mandarin/Cantonese Chinese dictionaries). There you can use jsomers's method above.

Also it's been a while since Apple added the System Integrity Protection to the OS X, so you will have to disable it before writing to the .plist file.

I'm quite happy that Apple haven't given up on the good old WotD, and updated it a little in Mojave. Hope they can provide even more dictionary choices in the future.

-2

This should solve your problem: http://www.makeuseof.com/tag/easily-expanding-apple-dictionary-–-mac-only/

1
  • See Lauri's comment. It doesn't work with the screensaver.
    – scrrr
    Jun 27, 2013 at 12:08

You must log in to answer this question.

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