<div>Hi,</div><div><br></div><div>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.</div>


<div><br></div><div>(1) i18n mo files location</div><div><br></div><div>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.</div>


<div><br></div><div>(2) install_data.data_files</div><div><br></div><div>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&#39;t understand what I am missing that worked before and not now.</div>

<div><br></div><div>Here is the setup.py script:</div><div><a href="https://github.com/brunobraga/termsaver/blob/master/setup.py" target="_blank">https://github.com/brunobraga/termsaver/blob/master/setup.py</a></div>
<div><br></div><div>And this is the i18n module I am using as base for localizing all text in the application:</div><div><a href="https://github.com/brunobraga/termsaver/blob/master/termsaverlib/i18n.py" target="_blank">https://github.com/brunobraga/termsaver/blob/master/termsaverlib/i18n.py</a></div>

<br clear="all">Here is the output of a clean install:<br><br><div><font face="&#39;courier new&#39;, monospace" size="1">bruno@development3;~$  sudo python setup.py install --record /tmp/termsaver.install.record.txt</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">[sudo] password for bruno: </font></div><div><font face="&#39;courier new&#39;, monospace" size="1">running install</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">running build</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">running build_py</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">creating build</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">creating build/lib.linux-i686-2.7</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">creating build/lib.linux-i686-2.7/termsaverlib</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/constants.py -&gt; build/lib.linux-i686-2.7/termsaverlib</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/i18n.py -&gt; build/lib.linux-i686-2.7/termsaverlib</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/common.py -&gt; build/lib.linux-i686-2.7/termsaverlib</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/exception.py -&gt; build/lib.linux-i686-2.7/termsaverlib</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/__init__.py -&gt; build/lib.linux-i686-2.7/termsaverlib</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">creating build/lib.linux-i686-2.7/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/programmer.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/rssfeed.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/rfc.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/urlfetcher.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/jokes4all.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/dot.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/__init__.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/asciiartfarts.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/quotes4all.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/randtxt.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">creating build/lib.linux-i686-2.7/termsaverlib/screen/base</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/base/rssfeed.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen/base</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/base/urlfetcher.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen/base</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/base/filereader.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen/base</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/base/__init__.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen/base</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">creating build/lib.linux-i686-2.7/termsaverlib/screen/helper</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/helper/position.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen/helper</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/helper/urlfetcher.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen/helper</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/helper/typing.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen/helper</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/helper/xmlreader.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen/helper</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying termsaverlib/screen/helper/__init__.py -&gt; build/lib.linux-i686-2.7/termsaverlib/screen/helper</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">running build_scripts</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">creating build/scripts-2.7</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying and adjusting termsaver -&gt; build/scripts-2.7</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">changing mode of build/scripts-2.7/termsaver from 644 to 755</font></div><div><b><font face="&#39;courier new&#39;, monospace" size="1">running build_trans</font></b></div>

<div><b><font face="&#39;courier new&#39;, monospace" size="1">Compiling locale/ja.po</font></b></div><div><b><font face="&#39;courier new&#39;, monospace" size="1">Compiling locale/en.po</font></b></div><div><font face="&#39;courier new&#39;, monospace" size="1">running install_lib</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">creating /usr/local/lib/python2.7/dist-packages/termsaverlib</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/constants.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">creating /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/programmer.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/rssfeed.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/rfc.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/urlfetcher.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/jokes4all.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/dot.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">creating /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/base/rssfeed.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/base/urlfetcher.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/base/filereader.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/base/__init__.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/__init__.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/asciiartfarts.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">creating /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/position.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/urlfetcher.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper</font></div><div>

<font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/typing.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/xmlreader.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/helper/__init__.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper</font></div><div>

<font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/quotes4all.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/screen/randtxt.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib/screen</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/i18n.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/common.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/exception.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/lib.linux-i686-2.7/termsaverlib/__init__.py -&gt; /usr/local/lib/python2.7/dist-packages/termsaverlib</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/constants.py to constants.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/programmer.py to programmer.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/rssfeed.py to rssfeed.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/rfc.py to rfc.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/urlfetcher.py to urlfetcher.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/jokes4all.py to jokes4all.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/dot.py to dot.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base/rssfeed.py to rssfeed.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base/urlfetcher.py to urlfetcher.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base/filereader.py to filereader.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/base/__init__.py to __init__.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/__init__.py to __init__.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/asciiartfarts.py to asciiartfarts.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/position.py to position.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/urlfetcher.py to urlfetcher.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/typing.py to typing.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/xmlreader.py to xmlreader.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/helper/__init__.py to __init__.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/quotes4all.py to quotes4all.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/screen/randtxt.py to randtxt.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/i18n.py to i18n.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/common.py to common.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/exception.py to exception.pyc</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">byte-compiling /usr/local/lib/python2.7/dist-packages/termsaverlib/__init__.py to __init__.pyc</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">running install_scripts</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">copying build/scripts-2.7/termsaver -&gt; /usr/local/bin</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">changing mode of /usr/local/bin/termsaver to 755</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">running install_egg_info</font></div><div>

<font face="&#39;courier new&#39;, monospace" size="1">Writing /usr/local/lib/python2.7/dist-packages/termsaver-0.1_beta.egg-info</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">writing list of installed files to &#39;/tmp/termsaver.install.record.txt&#39;</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">Thank you for trying termsaver.</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">bruno@development3;~$ </font></div><div><br></div><br>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.<div>

<br></div><div>Thank you in advance,<br><br><span style="font-family:courier new,monospace">--</span><br style="font-family:courier new,monospace">
<b style="font-family:courier new,monospace">Braga, Bruno</b><br style="font-family:courier new,monospace"><a style="font-family:courier new,monospace" href="http://www.brunobraga.net" target="_blank">www.brunobraga.net</a><br style="font-family:courier new,monospace">


<a style="font-family:courier new,monospace" href="mailto:bruno.braga@gmail.com" target="_blank">bruno.braga@gmail.com</a><br>
</div>