“It was true that there was already shaping in [the Habsburg] court a disaster that was to consume us all; but this did not appear to English eyes, largely because Austria was visited before the war only by our upper classes, who in no country noticed anything but horses, and Austrian horses were good.” — Rebecca West, Black Lamb and Grey Falcon

Adding South African English and Afrikaans spellchecking to a Mac

Adding spellchecking for South African languages to a Mac is relatively easy, mainly because OS X (since Snow Leopard) uses Hunspell as its spellchecking engine. All you need to do to add support for a language is to place two language-specific files (a .aff and a .dic) file in the Spelling directory in your library (~/Library/Spelling/).

The best place to find dictionaries for South African languages used to be translate.org.za, but at the moment the site seems to be down and I’m not sure if they are still active. I found the relevant files by downloading language packs for LibreOffice from libreoffice.org. To make things a little easier for you, I’m hosting the files for South African English and for Afrikaans here. The archive contains en_ZA.aff, en_ZA.dic, af_ZA.aff and af_ZA.dic. You can find language packs for several other South African langauges, including isiZulu and isiXhosa (the two largest indigenous languages).

To add the language support, download and extract the archive, and copy the four files into ~/Library/Spelling/. On Lion and Mountain Lion the Library folder is hidden by default, but you can easily get to it by option-clicking the “Go” menu item in the finder and selecting “Library”. Then navigate to “Spelling” and drop the files in there. You may have to restart before your Mac will notice their presence.

Then go to System Preferences -> Language & Text -> Text. Then, using the drop-down under “Language” you can either select “Automatic by Language” and activate the languages of your choice as well as drag them into the order you prefer (like I have in the screenshot below) or select a specific language for all spellchecking.

Installing Stata 12 on Ubuntu 12.04

Stata does not run out of the box on Ubuntu, although installing the required libraries etc. is farily trivial. In case this is useful to someone, I’m posting the instructions here:

First, create the directory where you’d like to install Stata and then run the installer from that directory as root. To avoid problems, it is best to put Stata in /usr/local/stata/ or /usr/local/stata12 You need to run the installer and much else as root. For example, insert the DVD and run:

sudo -s
mkdir /usr/local/stata12
cd /usr/local/stata12
/media/Stata/install

Follow the instructions. Then run the following and enter your licence details:

./stinit

If you try to execute Stata now, it will complain about missing libraries, namely libgtksourceview 1 and libgnomeprint 2. Since libgtksourceview version 1 is no longer in the Ubuntu archives, install version 2 and create a symlink where Stata expects version 1.

apt-get install libgtksourceview2.0-0 libgnomeprint2.2-0
ln -s /usr/lib/libgtksourceview-2.0.so.0 /usr/lib/libgtksourceview-1.0.so.0

You can now execute the appropriate version of Stata from the terminal, e.g.:

./xstata-mp

However, if you want Stata to show up in the dash and the launcher, you need to create a “desktop” file. This is fairly easy. Enter the following:

gedit /usr/share/applications/stata12.desktop

Then put the following in the file:

[Desktop Entry]
Version= 12.1
Terminal=false
Icon=/usr/local/stata12/stata12.png
Type=Application
Categories=Education;Scientific;
Exec=/usr/local/stata12/xstata-mp
MimeType=application/x-stata-dta;application/x-stata-do;
Name=Stata/MP 12
Comment=Perform statistical analyses using Stata.

If you want the mimetypes to work, you need to perform a little more work.

First, download and extract this archive. Then, from the directory where you extracted the files, issue these commands:

xdg-icon-resource install --context mimetypes --size 128 ./dta_128x128x32.png application-x-stata-dta
xdg-icon-resource install --context mimetypes --size 128 ./do_128x128x32.png application-x-stata-do

Then, create and edit a mimetype definition:

gedit /usr/share/mime/packages/application-x-stata.xml

and put the following in it:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="application/x-stata-dta">
    <comment>Stata data file</comment>
    <glob pattern="*.dta"/>
    <icon name="application-x-stata-dta"/>
  </mime-type>
  <mime-type type="application/x-stata-do">
    <comment>Stata do file</comment>
    <glob pattern="*.do"/>
    <icon name="application-x-stata-do"/>
  </mime-type>
</mime-info>

Finally, update the mime and desktop databases:

update-mime-database /usr/share/mime
update-desktop-database /usr/share/applications/    

You should now be up and running.