X Tutup
Skip to content

Commit 5de0725

Browse files
committed
i18n: _() now imported from bpython.translations
1 parent 1a58bbb commit 5de0725

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

bpython/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
# This for keys
5858
from bpython.keys import key_dispatch
5959

60+
# This for i18n
61+
from bpython.translations import _
62+
6063
from bpython import repl
6164
from bpython.pager import page
6265
import bpython.args
@@ -1724,9 +1727,6 @@ def main_curses(scr, args, config, interactive=True, locals_=None,
17241727
def main(args=None, locals_=None, banner=None):
17251728
global stdscr
17261729

1727-
import gettext
1728-
gettext.install('bpython')
1729-
17301730
setlocale(LC_ALL, '')
17311731

17321732
config, options, exec_args = bpython.args.parse(args)

bpython/gtk_.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@
4141

4242
from bpython import importcompletion, repl
4343
from bpython.formatter import theme_map
44+
from bpython.translations import _
4445
import bpython.args
4546

47+
4648
py3 = sys.version_info[0] == 3
4749

4850
_COLORS = dict(b='blue', c='cyan', g='green', m='magenta', r='red',

bpython/urwid.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
from bpython import args as bpargs, repl
4848
from bpython.formatter import theme_map
4949
from bpython.importcompletion import find_coroutine
50+
from bpython.translations import _
5051

5152
import urwid
5253

@@ -842,9 +843,6 @@ def tab(self, back=False):
842843
self._completion_update_suppressed = False
843844

844845
def main(args=None, locals_=None, banner=None):
845-
import gettext
846-
gettext.install('bpython')
847-
848846
# Err, somewhat redundant. There is a call to this buried in urwid.util.
849847
# That seems unfortunate though, so assume that's going away...
850848
locale.setlocale(locale.LC_ALL, '')

0 commit comments

Comments
 (0)
X Tutup