Skip to content
Browse files

Cleaned up i18n.py

  • Loading branch information...
1 parent 4247730 commit eebef3bc8a04ffc8cb965f439a79b2eaf011d43d @adamboduch adamboduch committed Apr 25, 2011
Showing with 5 additions and 8 deletions.
  1. +5 −8 gaphor/i18n.py
View
13 gaphor/i18n.py
@@ -1,10 +1,7 @@
-# vim:sw=4:et
-"""
-Internationalization (i18n) support for Gaphor.
+"""Internationalization (i18n) support for Gaphor.
Here the _() function is defined that is used to translate text into
-your native language.
-"""
+your native language."""
__all__ = [ '_' ]
@@ -13,15 +10,15 @@
import gettext
import pkg_resources
-# default locale dir = site-base/gaphor/data/locale/<lang>/LC_MESSAGES/gaphor.mo
localedir = os.path.join(pkg_resources.get_distribution('gaphor').location, \
'gaphor', 'data', 'locale')
try:
+
catalog = gettext.Catalog('gaphor', localedir=localedir)
- #log.info('catalog = %s' % catalog.info())
_ = catalog.gettext
+
except IOError, e:
- #log.error('Could not load locale catalog', exc_info=True)
+
def _(s): return s

0 comments on commit eebef3b

Please sign in to comment.
Something went wrong with that request. Please try again.