Replace stdout with one that uses a transcoding Streamwriter. This
better handles differences between Py2 and Py3 than does trying to
encode strings prior to output. In particular Py3's default stdout
demands unencoded strings and prints byte-strings when one tries to
pre-encode them.
svn: r21699
Only get an addon translator if the plugin has a locale directory
Prevents pointless warnings, esp. when the translations are in the
main Gramps message file.
svn: r21649
Lets one import grampslocale directly in a test script:
>>> from gramps.gen.utils.grampslocale import GrampsLocale
>>> import os
>>> gl = GrampsLocale(lang='fr_FR.UTF-8', localedir=os.path.join('build', 'mo'))
>>> tr = gl.get_translation().gettext
>>> tr("List of known family trees in your database path\n")
u'Liste des arbres familiaux connus dans votre chemin de base de donn\xe9es\n'
svn: r21647
from const.py to version.py
As noted in the previous change, importing const into setup.py tried to
initialize GrampsLocale and ResourcePath, which won't work. Since all we
want is the VERSION string, move that to a new file, gramps/version.py
svn: r21619
Uses GRAMPS_RESOURCES to override the root location of the Gramps data
files (which would normally be $(prefix)/share). In setup.py install,
writes $(prefix)/share to gen/utils/resource-path, installs that file,
then deletes it again from the source tree. The presence or absence
determines whether Gramps is running from the source directory or from
an installation.
Const.py is now a static file; const.py.in is no longer used. Note that
because importing const into setup tried to initialize things that we
don't want initialized, VERSION is removed, and imported from
gramps.version -- a file which will be added in the next change.
Consequently, this commit will not run.
svn: r21618
Make sure that lang overrides the language list only if $LANG is set. Don't add encodings to the language list (e.g., en_US, not en_US.UTF-8). Start collation with None, because `if collation:` is True for collation = "". defaults may have whitespace at the end of "root", so use "startswith".
svn: r21599
Replace "en" with "C" when setting $LANGUAGE ("en" confuses GtkBuilder), and explicitly iterate over languages when finding
the translator, because left to itself gettext will ignore English.
svn: r21598