Edgewall Software

Setting up Babel from a Subversion Checkout

Babel can be downloaded directly from the development repository using a Subversion client. For example, to obtain the most recent development version, you'd checkout the trunk directory:

$ svn co http://svn.edgewall.org/repos/babel/trunk babel
$ cd babel

Note that you can also access the repository using https if you're having problems with a braindead proxy.

Importing the Locale Data

Now, before you can actually use Babel from such a checkout, you first need to import the CLDR data. To do that, first download a CLDR release from here:

Unzip the core.zip file to a location of your choice.

From the directory into which you checked out Babel, do:

$ ./setup.py egg_info
$ ./scripts/import_cldr.py /path/to/cldrdir

This should dump a whole lot of output to the console, and at the end you'll have a large number of *.dat files in the babel/localedata directory.

If you get an error like UserWarning: Unknown distribution option: 'entry_points', you need to install setuptools and try again.

If you work from inside a Mercurial checkout (a clone of the http://bitbucket.org/edgewall/babel mirror, for example), you might get the following error:

IOError: [Errno 2] No such file or directory: '/usr/local/virtualenv/src/babel-mirror/scripts/../babel/localedata/root.dat'

This is because Mercurial doesn't support empty directories and the babel/localedata folder doesn't exist yet. Simply do:

$ mkdir babel/localedata

and retry.

Note: you'll need to repeat this process whenever you update your working copy and the import_cldr.py file has been changed.

Note that the CLDR import process requires ElementTree, either the version included with Python since version 2.5, or the normal ElementTree download. For Python versions prior to 2.5, easy_install'ing should work (but “normal” installation works, too):

$ sudo easy_install ElementTree

After the CLDR data has been successfully imported, Babel must be installed:

$ sudo ./setup.py install

Running the Testsuite

Currently you will need the pytz module when trying to run the testsuite through the command:

$ ./setup.py test

This is simple to install through easy_install:

$ sudo easy_install pytz

Generating Documentation

While source tarballs include the generated HTML documentation, repository checkouts only contain the source files. However, it's easy to generate the documentation yourself:

$ ./setup.py build_doc

This requires docutils, epydoc, genshi, and Pygments to be installed. Again, easy_install'ing those should work:

$ sudo easy_install docutils
$ sudo easy_install epydoc
$ sudo easy_install genshi
$ sudo easy_install Pygments

If you're extending the documentation text files, and are using docstrings, you should make sure those actually work using the following command:

$ ./setup.py test_doc

See also: Documentation

Last modified 4 years ago Last modified on Sep 11, 2012 3:29:38 PM