How to get the list of installed spell checker languages ?
28/11/04 18:42
If I want the user be able to select the language of specific text fields at runtime and save the selected language along with the text data, how can I access the list of available languages ?
There is no API to get the list of available languages.(You may fill a requirement wish to Apple...)
One tricky way to get them is to look in the view hierarchy of the Spell Checker panel for the pop-up containing the list of languages...
And an even more tricky one: access directly to the private variable _languagePopUp of NSSpellChecker class...
Ok, a less tricky one now: you can get the list of standard (Apple) dictionnaries by scanning the directory at /System/Library/Services/AppleSpell.service/Contents/Resources/*.lproj : the names of .lproj directories are the names of directories according to internationnal naming rules (e.g. en_AU means Australian English).
You still have to convert them into more user friendly (and localized) strings...
However this will not give you the list of other dictionaries registered by tools like Aspell or Ispell or any others...
One tricky way to get them is to look in the view hierarchy of the Spell Checker panel for the pop-up containing the list of languages...
And an even more tricky one: access directly to the private variable _languagePopUp of NSSpellChecker class...
Ok, a less tricky one now: you can get the list of standard (Apple) dictionnaries by scanning the directory at /System/Library/Services/AppleSpell.service/Contents/Resources/*.lproj : the names of .lproj directories are the names of directories according to internationnal naming rules (e.g. en_AU means Australian English).
You still have to convert them into more user friendly (and localized) strings...
However this will not give you the list of other dictionaries registered by tools like Aspell or Ispell or any others...