10.5: Make spell check show only desired languages

May 18, '09 07:30:02AM

Contributed by: petersconsult

In apps like TextEdit, Mail, Safari, etc. (but mainly Mail), I like to use the Multilingual option in the spell check dialog (Edit » Spelling » Show Spelling & Grammar) because I regularly write in English, French and Spanish. However, I really have little everyday use for the other languages, and they pose the problem that a word that may be misspelled in English, French or Spanish may actually exist in another language that is covered by the Apple spell checker.

So I removed all those other languages from the spell checker, and it works exactly as I'd hoped (even for grammar). Read on to see what I did.

First I created a folder called AppleSpellTest inside my folder zzz_Disabled_Stuff that is in my home folder. Then I made a backup of the files I was going to modify by doing this:

sudo cp -R /System/Library/Services/AppleSpell.service /Users/*Your_User*/zzz_Disabled_Stuff/AppleSpellTest/
Replace *Your_User* with your user's short username.

Then, I only wanted French, English, Spanish, and Multilingual (don't forget this is an option when we edit the menu later), so I moved all the rest of the files like this:
$ sudo su
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/Danish.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages 
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/Dutch.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages 
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/en_AU.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages 
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/en_CA.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages 
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages 
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/German.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages 
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/Italian.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages 
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/Portuguese.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages 
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/Russian.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages 
$ mv /System/Library/Services/AppleSpell.service/Contents/Resources/Swedish.lproj /Users/*Your_Home*/zzz_Disabled_Stuff/AppleSpellTest/DisabledLanguages
$ exit
As before, replace *Your_User* with your user's short username. Now all I had to do was change the menu itself. First I open the Info.plist file for editing as root in TextEdit:
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /System/Library/Services/AppleSpell.service/Contents/Info.plist
You can also edit the plist file with BBEdit or Apple's Property List Editor. In the editor, remove all the languages (under where it says array) except for en, fr, es, and multilingual so that the menu section looks like this:
  <array>
    <dict>
      <key>NSExecutable</key>
      <string>AppleSpell</string>
      <key>NSLanguages</key>
      <array>
        <string>en</string>
        <string>fr</string>
        <string>es</string>
        <string>Multilingual</string>
      </array>
      <key>NSPortName</key>
      <string>AppleSpell</string>
      <key>NSSpellChecker</key>
      <string>Apple</string>
    </dict>
  </array>
Save, restart the Mac, and you're done -- and it really works!

[robg adds: In OS X 10.5, I'm not sure if this will break code signing or not. I have not tested this hint.]

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20090512175846504