X Tutup
Skip to content

Commit 5793932

Browse files
committed
Few revisions about i18n.
Merge from Trundle bpython-i18n repo.
1 parent 662713b commit 5793932

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

bpython/gtk_.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ def formatvalue(self, value):
8787

8888

8989
class ExceptionDialog(gtk.MessageDialog):
90-
def __init__(self, exc_type, exc_value, tb, text=_('An error occurred.')):
90+
def __init__(self, exc_type, exc_value, tb, text=None):
91+
if text is None:
92+
text = _('An error occurred.')
9193
gtk.MessageDialog.__init__(self, buttons=gtk.BUTTONS_CLOSE,
9294
type=gtk.MESSAGE_ERROR,
9395
message_format=text)
@@ -110,9 +112,9 @@ class ExceptionManager(object):
110112
the exception's type, value, a traceback and a text to display as
111113
arguments.
112114
"""
113-
def __init__(self, DialogType, text=_('An error occurred.')):
115+
def __init__(self, DialogType, text=None):
114116
self.DialogType = DialogType
115-
self.text = text
117+
self.text = text or _('An error occurred.')
116118

117119
def __enter__(self):
118120
return self
@@ -765,9 +767,6 @@ def init_import_completion():
765767

766768

767769
def main(args=None):
768-
import gettext
769-
gettext.install('bpython')
770-
771770
setlocale(LC_ALL, '')
772771

773772
gtk_options = (_('gtk-specific options'),

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def initialize_options(self):
7070

7171
cmdclass = dict(build_py=build_py,
7272
build = build)
73-
# localization options: see i18n/README for more informations
73+
# localization options
7474
if using_translations:
7575
cmdclass['compile_catalog'] = compile_catalog
7676
cmdclass['extract_messages'] = extract_messages

0 commit comments

Comments
 (0)
X Tutup