setup.py, data_files and i18n
Hi, I am working on a project written in Python, and I would like to use i18n functionality, but I am having some issues with it, more specifically regarding the .mo files location, and I was hoping someone here could point me in the right direction. (1) i18n mo files location Basically, I already know how to translate contents with gettext, but I got stuck with the fact that it, by default, looks at /usr/share/locale/{language} (in Linux), but the setup.py install data_files into /usr/local/share/... unless I forcibly use absolute paths toward the location where the files should be. (2) install_data.data_files Also, I am having a problem to install the data_files, because the install_data command is never called. I made it work before, but I don't understand what I am missing that worked before and not now. Here is the setup.py script: https://github.com/brunobraga/termsaver/blob/master/setup.py And this is the i18n module I am using as base for localizing all text in the application: https://github.com/brunobraga/termsaver/blob/master/termsaverlib/i18n.py Here is the output of a clean install: bruno@development3;~$ sudo python setup.py install --record /tmp/termsaver.install.record.txt [sudo] password for bruno: running install running build running build_py creating build creating build/lib.linux-i686-2.7 creating build/lib.linux-i686-2.7/termsaverlib copying termsaverlib/constants.py -> build/lib.linux-i686-2.7/termsaverlib copying termsaverlib/i18n.py -> build/lib.linux-i686-2.7/termsaverlib copying termsaverlib/common.py -> build/lib.linux-i686-2.7/termsaverlib copying termsaverlib/exception.py -> build/lib.linux-i686-2.7/termsaverlib copying termsaverlib/__init__.py -> build/lib.linux-i686-2.7/termsaverlib creating build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/programmer.py -> build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/rssfeed.py -> build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/rfc.py -> build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/urlfetcher.py -> build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/jokes4all.py -> build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/dot.py -> build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/__init__.py -> build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/asciiartfarts.py -> build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/quotes4all.py -> build/lib.linux-i686-2.7/termsaverlib/screen copying termsaverlib/screen/randtxt.py -> build/lib.linux-i686-2.7/termsaverlib/screen creating build/lib.linux-i686-2.7/termsaverlib/screen/base copying termsaverlib/screen/base/rssfeed.py -> build/lib.linux-i686-2.7/termsaverlib/screen/base copying termsaverlib/screen/base/urlfetcher.py -> build/lib.linux-i686-2.7/termsaverlib/screen/base copying termsaverlib/screen/base/filereader.py -> build/lib.linux-i686-2.7/termsaverlib/screen/base copying termsaverlib/screen/base/__init__.py -> build/lib.linux-i686-2.7/termsaverlib/screen/base creating build/lib.linux-i686-2.7/termsaverlib/screen/helper copying termsaverlib/screen/helper/position.py -> build/lib.linux-i686-2.7/termsaverlib/screen/helper copying termsaverlib/screen/helper/urlfetcher.py -> build/lib.linux-i686-2.7/termsaverlib/screen/helper copying termsaverlib/screen/helper/typing.py -> build/lib.linux-i686-2.7/termsaverlib/screen/helper copying termsaverlib/screen/helper/xmlreader.py -> build/lib.linux-i686-2.7/termsaverlib/screen/helper copying termsaverlib/screen/helper/__init__.py -> build/lib.linux-i686-2.7/termsaverlib/screen/helper running build_scripts creating build/scripts-2.7 copying and adjusting termsaver -> build/scripts-2.7 changing mode of build/scripts-2.7/termsaver from 644 to 755 *running build_trans* *Compiling locale/ja.po* *Compiling locale/en.po* running install_lib creating /usr/local/lib/python2.7/dist-packages/termsaverlib copying build/lib.linux-i686-2.7/termsaverlib/constants.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib creating /usr/local/lib/python2.7/dist-packages/termsaverlib/screen copying build/lib.linux-i686-2.7/termsaverlib/screen/programmer.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen copying build/lib.linux-i686-2.7/termsaverlib/screen/rssfeed.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen copying build/lib.linux-i686-2.7/termsaverlib/screen/rfc.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen copying build/lib.linux-i686-2.7/termsaverlib/screen/urlfetcher.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen copying build/lib.linux-i686-2.7/termsaverlib/screen/jokes4all.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen copying build/lib.linux-i686-2.7/termsaverlib/screen/dot.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen creating /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base copying build/lib.linux-i686-2.7/termsaverlib/screen/base/rssfeed.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base copying build/lib.linux-i686-2.7/termsaverlib/screen/base/urlfetcher.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base copying build/lib.linux-i686-2.7/termsaverlib/screen/base/filereader.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base copying build/lib.linux-i686-2.7/termsaverlib/screen/base/__init__.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base copying build/lib.linux-i686-2.7/termsaverlib/screen/__init__.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen copying build/lib.linux-i686-2.7/termsaverlib/screen/asciiartfarts.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen creating /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/position.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/urlfetcher.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/typing.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/xmlreader.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/__init__.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper copying build/lib.linux-i686-2.7/termsaverlib/screen/quotes4all.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen copying build/lib.linux-i686-2.7/termsaverlib/screen/randtxt.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib/screen copying build/lib.linux-i686-2.7/termsaverlib/i18n.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib copying build/lib.linux-i686-2.7/termsaverlib/common.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib copying build/lib.linux-i686-2.7/termsaverlib/exception.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib copying build/lib.linux-i686-2.7/termsaverlib/__init__.py -> /usr/local/lib/python2.7/dist-packages/termsaverlib byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/constants.py to constants.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/programmer.py to programmer.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/rssfeed.py to rssfeed.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/rfc.py to rfc.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/urlfetcher.py to urlfetcher.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/jokes4all.py to jokes4all.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/dot.py to dot.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base/rssfeed.py to rssfeed.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base/urlfetcher.py to urlfetcher.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base/filereader.py to filereader.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base/__init__.py to __init__.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/__init__.py to __init__.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/asciiartfarts.py to asciiartfarts.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/position.py to position.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/urlfetcher.py to urlfetcher.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/typing.py to typing.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/xmlreader.py to xmlreader.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/__init__.py to __init__.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/quotes4all.py to quotes4all.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/randtxt.py to randtxt.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/i18n.py to i18n.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/common.py to common.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/exception.py to exception.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/__init__.py to __init__.pyc running install_scripts copying build/scripts-2.7/termsaver -> /usr/local/bin changing mode of /usr/local/bin/termsaver to 755 running install_egg_info Writing /usr/local/lib/python2.7/dist-packages/termsaver-0.1_beta.egg-info writing list of installed files to '/tmp/termsaver.install.record.txt' Thank you for trying termsaver. bruno@development3;~$ Any help is much appreciated. I found very hard to do anything with distutils unless I open the source and see by myself what it can do or not... I was hoping there is a better way. Thank you in advance, -- *Braga, Bruno* www.brunobraga.net bruno.braga@gmail.com
participants (1)
-
BRAGA, Bruno