On Oct 1, 2008, at 11:25 AM, Toshio Kuratomi wrote:
Jeroen Ruigrok van der Werven wrote:
-On [20081001 16:28], Toshio Kuratomi (a.badger@gmail.com) wrote:
and have distutils do the right thing with the .po files at build time (generate .mo files from them) and at install time (install them into PREFIX/share/locales/LC_MESSAGES/, or wherever the distribution is configured to put them).
[snip]
This has been a big deal for some applications I work on. Our first cut was to add new Build and InstallData command classes.
Actually with Babel (http://babel.edgewall.org/) that's all handled.
That's good to know. One of our Turbogears applications uses Babel and it definitely doesn't install to the right place. I'd love to fix it to take advantage of Babel' properly. Would you be kind enough to point me documentation on how to get Babel to install locale files? Looking at the babel website, I only see documentation up to building the message catalogs. If the install portion is integrated into setuptools is there something I might have to configure in setup() to tell babel/ setuptools what directory to use?
Once you have Babel generating .mo files, all you'll need is a package_data entry for them, e.g.: package_data={'foo': ['i18n/*/LC_MESSAGES/*.mo']}, then the catalogs will make it into the final sdist/egg and be included during an installation. -- Philip Jenvey