Skip to content

Commit d2600fc

Browse files
committed
Make help message translatable
1 parent 7049f1c commit d2600fc

File tree

7 files changed

+566
-382
lines changed

7 files changed

+566
-382
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,6 @@
5858

5959
INCONSISTENT_HISTORY_MSG = "#<---History inconsistent with output shown--->"
6060
CONTIGUITY_BROKEN_MSG = "#<---History contiguity broken by rewind--->"
61-
HELP_MESSAGE = """
62-
Thanks for using bpython!
63-
64-
See http://bpython-interpreter.org/ for more information and http://docs.bpython-interpreter.org/ for docs.
65-
Please report issues at https://github.com/bpython/bpython/issues
66-
67-
Features:
68-
Try using undo ({config.undo_key})!
69-
Edit the current line ({config.edit_current_block_key}) or the entire session ({config.external_editor_key}) in an external editor. (currently {config.editor})
70-
Save sessions ({config.save_key}) or post them to pastebins ({config.pastebin_key})! Current pastebin helper: {config.pastebin_helper}
71-
Reload all modules and rerun session ({config.reimport_key}) to test out changes to a module.
72-
Toggle auto-reload mode ({config.toggle_file_watch_key}) to re-execute the current session when a module you've imported is modified.
73-
74-
bpython -i your_script.py runs a file in interactive mode
75-
bpython -t your_script.py pastes the contents of a file into the session
76-
77-
A config file at {config.config_path} customizes keys and behavior of bpython.
78-
You can also set which pastebin helper and which external editor to use.
79-
See {example_config_url} for an example config file.
80-
Press {config.edit_config_key} to edit this config file.
81-
"""
8261
EXAMPLE_CONFIG_URL = "https://raw.githubusercontent.com/bpython/bpython/master/bpython/sample-config"
8362
EDIT_SESSION_HEADER = """### current bpython session - make changes and save to reevaluate session.
8463
### lines beginning with ### will be ignored.
@@ -1976,16 +1955,29 @@ def help_text(self):
19761955
return self.version_help_text() + "\n" + self.key_help_text()
19771956

19781957
def version_help_text(self):
1979-
return (
1980-
("bpython-curtsies version %s" % bpython.__version__)
1981-
+ " "
1982-
+ ("using curtsies version %s" % curtsies.__version__)
1983-
+ "\n"
1984-
+ HELP_MESSAGE.format(
1985-
example_config_url=EXAMPLE_CONFIG_URL,
1986-
config=self.config,
1987-
)
1988-
)
1958+
help_message = _("""
1959+
Thanks for using bpython!
1960+
1961+
See http://bpython-interpreter.org/ for more information and http://docs.bpython-interpreter.org/ for docs.
1962+
Please report issues at https://github.com/bpython/bpython/issues
1963+
1964+
Features:
1965+
Try using undo ({config.undo_key})!
1966+
Edit the current line ({config.edit_current_block_key}) or the entire session ({config.external_editor_key}) in an external editor. (currently {config.editor})
1967+
Save sessions ({config.save_key}) or post them to pastebins ({config.pastebin_key})! Current pastebin helper: {config.pastebin_helper}
1968+
Reload all modules and rerun session ({config.reimport_key}) to test out changes to a module.
1969+
Toggle auto-reload mode ({config.toggle_file_watch_key}) to re-execute the current session when a module you've imported is modified.
1970+
1971+
bpython -i your_script.py runs a file in interactive mode
1972+
bpython -t your_script.py pastes the contents of a file into the session
1973+
1974+
A config file at {config.config_path} customizes keys and behavior of bpython.
1975+
You can also set which pastebin helper and which external editor to use.
1976+
See {example_config_url} for an example config file.
1977+
Press {config.edit_config_key} to edit this config file.
1978+
""").format(example_config_url=EXAMPLE_CONFIG_URL, config=self.config)
1979+
1980+
return f"bpython-curtsies version {bpython.__version__} using curtsies version {curtsies.__version__}\n{help_message}"
19891981

19901982
def key_help_text(self):
19911983
NOT_IMPLEMENTED = (

0 commit comments

Comments
 (0)