/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: David Planella
  • Date: 2011-03-06 09:03:47 UTC
  • mto: This revision was merged to the branch mainline in revision 719.
  • Revision ID: david.planella@ubuntu.com-20110306090347-9xhxn9mfuk4bbjg6
Added proper i18n support with gettext

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    bzr_plugin_version as version_info,
63
63
    bzr_compatible_versions,
64
64
    )
 
65
from gettext import (
 
66
    gettext,
 
67
    textdomain
 
68
    )
 
69
 
 
70
# FIXME: We should find out LOCALEDIR at compile or run time. The current
 
71
# hardcoded path will work for most distributions, but not for e.g. Solaris and
 
72
# Windows
 
73
GETTEXT_PACKAGE = 'bzr-gtk'
 
74
LOCALEDIR = '/usr/share/locale'
 
75
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR)
 
76
bind_textdomain_codeset(GETTEXT_PACKAGE, 'UTF-8')
 
77
textdomain(GETTEXT_PACKAGE)
65
78
 
66
79
if version_info[3] == 'final':
67
80
    version_string = '%d.%d.%d' % version_info[:3]
181
194
 
182
195
 
183
196
def _i18n(text):
184
 
    # Stub until we support proper i18n
185
 
    return text
 
197
    return gettext(text)