Skip to content

Commit f868eff

Browse files
committed
Make strings that are used in --help translatable.
1 parent 43f83fc commit f868eff

File tree

7 files changed

+238
-32
lines changed

7 files changed

+238
-32
lines changed

bpython/args.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from bpython import __version__
1212
from bpython.config import default_config_path, loadini, Struct
13+
from bpython.translations import _
1314

1415

1516
class OptionParserFailed(ValueError):
@@ -49,24 +50,24 @@ def parse(args, extras=None, ignore_stdin=False):
4950
args = sys.argv[1:]
5051

5152
parser = RaisingOptionParser(
52-
usage='Usage: %prog [options] [file [args]]\n'
53+
usage=_('Usage: %prog [options] [file [args]]\n'
5354
'NOTE: If bpython sees an argument it does '
5455
'not know, execution falls back to the '
55-
'regular Python interpreter.')
56+
'regular Python interpreter.'))
5657
# This is not sufficient if bpython gains its own -m support
5758
# (instead of falling back to Python itself for that).
5859
# That's probably fixable though, for example by having that
5960
# option swallow all remaining arguments in a callback.
6061
parser.disable_interspersed_args()
6162
parser.add_option('--config', default=default_config_path(),
62-
help='use CONFIG instead of default config file')
63+
help=_('Use CONFIG instead of default config file.'))
6364
parser.add_option('--interactive', '-i', action='store_true',
64-
help='Drop to bpython shell after running file '
65-
'instead of exiting')
65+
help=_('Drop to bpython shell after running file '
66+
'instead of exiting.'))
6667
parser.add_option('--quiet', '-q', action='store_true',
67-
help="Don't flush the output to stdout.")
68+
help=_("Don't flush the output to stdout."))
6869
parser.add_option('--version', '-V', action='store_true',
69-
help='print version and exit')
70+
help=_('Print version and exit.'))
7071

7172
if extras is not None:
7273
extras_group = OptionGroup(parser, extras[0], extras[1])

bpython/translations/bpython.pot

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: bpython mercurial\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2012-07-14 21:45+0200\n"
11+
"POT-Creation-Date: 2012-07-16 12:50+0200\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,19 +17,42 @@ msgstr ""
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Generated-By: Babel 0.9.6\n"
1919

20-
#: bpython/cli.py:303 bpython/urwid.py:529
20+
#: bpython/args.py:53
21+
msgid ""
22+
"Usage: %prog [options] [file [args]]\n"
23+
"NOTE: If bpython sees an argument it does not know, execution falls back "
24+
"to the regular Python interpreter."
25+
msgstr ""
26+
27+
#: bpython/args.py:63
28+
msgid "Use CONFIG instead of default config file."
29+
msgstr ""
30+
31+
#: bpython/args.py:65
32+
msgid "Drop to bpython shell after running file instead of exiting."
33+
msgstr ""
34+
35+
#: bpython/args.py:68
36+
msgid "Don't flush the output to stdout."
37+
msgstr ""
38+
39+
#: bpython/args.py:70
40+
msgid "Print version and exit."
41+
msgstr ""
42+
43+
#: bpython/cli.py:303 bpython/urwid.py:550
2144
msgid "y"
2245
msgstr ""
2346

24-
#: bpython/cli.py:303 bpython/urwid.py:529
47+
#: bpython/cli.py:303 bpython/urwid.py:550
2548
msgid "yes"
2649
msgstr ""
2750

2851
#: bpython/cli.py:970 bpython/gtk_.py:484
2952
msgid "Cannot show source."
3053
msgstr ""
3154

32-
#: bpython/cli.py:1642 bpython/urwid.py:591
55+
#: bpython/cli.py:1642 bpython/urwid.py:612
3356
#, python-format
3457
msgid " <%s> Rewind <%s> Save <%s> Pastebin <%s> Pager <%s> Show Source "
3558
msgstr ""
@@ -131,3 +154,21 @@ msgstr ""
131154
msgid "Upload failed: Failed to recognize the helper program's output as an URL."
132155
msgstr ""
133156

157+
#: bpython/urwid.py:1108
158+
msgid "Run a reactor (see --help-reactors)."
159+
msgstr ""
160+
161+
#: bpython/urwid.py:1110
162+
msgid "List available reactors for -r."
163+
msgstr ""
164+
165+
#: bpython/urwid.py:1112
166+
msgid ""
167+
"twistd plugin to run (use twistd for a list). Use \"--\" to pass further "
168+
"options to the plugin."
169+
msgstr ""
170+
171+
#: bpython/urwid.py:1115
172+
msgid "Port to run an eval server on (forces Twisted)."
173+
msgstr ""
174+

bpython/translations/de/LC_MESSAGES/bpython.po

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: bpython mercurial\n"
99
"Report-Msgid-Bugs-To: http://bitbucket.org/bobf/bpython/issues\n"
10-
"POT-Creation-Date: 2012-07-14 21:45+0200\n"
10+
"POT-Creation-Date: 2012-07-16 12:50+0200\n"
1111
"PO-Revision-Date: 2012-04-05 09:37+0200\n"
1212
"Last-Translator: Sebastian Ramacher <sebastian+dev@ramacher.at>\n"
1313
"Language-Team: de <LL@li.org>\n"
@@ -17,19 +17,42 @@ msgstr ""
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Generated-By: Babel 0.9.6\n"
1919

20-
#: bpython/cli.py:303 bpython/urwid.py:529
20+
#: bpython/args.py:53
21+
msgid ""
22+
"Usage: %prog [options] [file [args]]\n"
23+
"NOTE: If bpython sees an argument it does not know, execution falls back "
24+
"to the regular Python interpreter."
25+
msgstr ""
26+
27+
#: bpython/args.py:63
28+
msgid "Use CONFIG instead of default config file."
29+
msgstr ""
30+
31+
#: bpython/args.py:65
32+
msgid "Drop to bpython shell after running file instead of exiting."
33+
msgstr ""
34+
35+
#: bpython/args.py:68
36+
msgid "Don't flush the output to stdout."
37+
msgstr ""
38+
39+
#: bpython/args.py:70
40+
msgid "Print version and exit."
41+
msgstr ""
42+
43+
#: bpython/cli.py:303 bpython/urwid.py:550
2144
msgid "y"
2245
msgstr "j"
2346

24-
#: bpython/cli.py:303 bpython/urwid.py:529
47+
#: bpython/cli.py:303 bpython/urwid.py:550
2548
msgid "yes"
2649
msgstr "ja"
2750

2851
#: bpython/cli.py:970 bpython/gtk_.py:484
2952
msgid "Cannot show source."
3053
msgstr "Kann Quellcode nicht anzeigen."
3154

32-
#: bpython/cli.py:1642 bpython/urwid.py:591
55+
#: bpython/cli.py:1642 bpython/urwid.py:612
3356
#, python-format
3457
msgid " <%s> Rewind <%s> Save <%s> Pastebin <%s> Pager <%s> Show Source "
3558
msgstr ""
@@ -131,3 +154,21 @@ msgstr ""
131154
msgid "Upload failed: Failed to recognize the helper program's output as an URL."
132155
msgstr ""
133156

157+
#: bpython/urwid.py:1108
158+
msgid "Run a reactor (see --help-reactors)."
159+
msgstr ""
160+
161+
#: bpython/urwid.py:1110
162+
msgid "List available reactors for -r."
163+
msgstr ""
164+
165+
#: bpython/urwid.py:1112
166+
msgid ""
167+
"twistd plugin to run (use twistd for a list). Use \"--\" to pass further "
168+
"options to the plugin."
169+
msgstr ""
170+
171+
#: bpython/urwid.py:1115
172+
msgid "Port to run an eval server on (forces Twisted)."
173+
msgstr ""
174+

bpython/translations/es_ES/LC_MESSAGES/bpython.po

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: bpython 0.9.7\n"
99
"Report-Msgid-Bugs-To: http://bitbucket.org/bobf/bpython/issues\n"
10-
"POT-Creation-Date: 2012-07-14 21:45+0200\n"
10+
"POT-Creation-Date: 2012-07-16 12:50+0200\n"
1111
"PO-Revision-Date: 2010-07-21 14:46+0200\n"
1212
"Last-Translator: Claudia Medde\n"
1313
"Language-Team: bpython developers\n"
@@ -17,19 +17,42 @@ msgstr ""
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Generated-By: Babel 0.9.6\n"
1919

20-
#: bpython/cli.py:303 bpython/urwid.py:529
20+
#: bpython/args.py:53
21+
msgid ""
22+
"Usage: %prog [options] [file [args]]\n"
23+
"NOTE: If bpython sees an argument it does not know, execution falls back "
24+
"to the regular Python interpreter."
25+
msgstr ""
26+
27+
#: bpython/args.py:63
28+
msgid "Use CONFIG instead of default config file."
29+
msgstr ""
30+
31+
#: bpython/args.py:65
32+
msgid "Drop to bpython shell after running file instead of exiting."
33+
msgstr ""
34+
35+
#: bpython/args.py:68
36+
msgid "Don't flush the output to stdout."
37+
msgstr ""
38+
39+
#: bpython/args.py:70
40+
msgid "Print version and exit."
41+
msgstr ""
42+
43+
#: bpython/cli.py:303 bpython/urwid.py:550
2144
msgid "y"
2245
msgstr "s"
2346

24-
#: bpython/cli.py:303 bpython/urwid.py:529
47+
#: bpython/cli.py:303 bpython/urwid.py:550
2548
msgid "yes"
2649
msgstr "si"
2750

2851
#: bpython/cli.py:970 bpython/gtk_.py:484
2952
msgid "Cannot show source."
3053
msgstr "Imposible mostrar el código fuente"
3154

32-
#: bpython/cli.py:1642 bpython/urwid.py:591
55+
#: bpython/cli.py:1642 bpython/urwid.py:612
3356
#, python-format
3457
msgid " <%s> Rewind <%s> Save <%s> Pastebin <%s> Pager <%s> Show Source "
3558
msgstr ""
@@ -133,3 +156,21 @@ msgstr ""
133156
msgid "Upload failed: Failed to recognize the helper program's output as an URL."
134157
msgstr ""
135158

159+
#: bpython/urwid.py:1108
160+
msgid "Run a reactor (see --help-reactors)."
161+
msgstr ""
162+
163+
#: bpython/urwid.py:1110
164+
msgid "List available reactors for -r."
165+
msgstr ""
166+
167+
#: bpython/urwid.py:1112
168+
msgid ""
169+
"twistd plugin to run (use twistd for a list). Use \"--\" to pass further "
170+
"options to the plugin."
171+
msgstr ""
172+
173+
#: bpython/urwid.py:1115
174+
msgid "Port to run an eval server on (forces Twisted)."
175+
msgstr ""
176+

bpython/translations/it_IT/LC_MESSAGES/bpython.po

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: bpython 0.9.7\n"
99
"Report-Msgid-Bugs-To: http://bitbucket.org/bobf/bpython/issues\n"
10-
"POT-Creation-Date: 2012-07-14 21:45+0200\n"
10+
"POT-Creation-Date: 2012-07-16 12:50+0200\n"
1111
"PO-Revision-Date: 2010-07-21 13:53+0200\n"
1212
"Last-Translator: Michele Orrù\n"
1313
"Language-Team: Michele Orrù\n"
@@ -17,19 +17,42 @@ msgstr ""
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Generated-By: Babel 0.9.6\n"
1919

20-
#: bpython/cli.py:303 bpython/urwid.py:529
20+
#: bpython/args.py:53
21+
msgid ""
22+
"Usage: %prog [options] [file [args]]\n"
23+
"NOTE: If bpython sees an argument it does not know, execution falls back "
24+
"to the regular Python interpreter."
25+
msgstr ""
26+
27+
#: bpython/args.py:63
28+
msgid "Use CONFIG instead of default config file."
29+
msgstr ""
30+
31+
#: bpython/args.py:65
32+
msgid "Drop to bpython shell after running file instead of exiting."
33+
msgstr ""
34+
35+
#: bpython/args.py:68
36+
msgid "Don't flush the output to stdout."
37+
msgstr ""
38+
39+
#: bpython/args.py:70
40+
msgid "Print version and exit."
41+
msgstr ""
42+
43+
#: bpython/cli.py:303 bpython/urwid.py:550
2144
msgid "y"
2245
msgstr "s"
2346

24-
#: bpython/cli.py:303 bpython/urwid.py:529
47+
#: bpython/cli.py:303 bpython/urwid.py:550
2548
msgid "yes"
2649
msgstr "si"
2750

2851
#: bpython/cli.py:970 bpython/gtk_.py:484
2952
msgid "Cannot show source."
3053
msgstr "Non è possibile mostrare il codice sorgente"
3154

32-
#: bpython/cli.py:1642 bpython/urwid.py:591
55+
#: bpython/cli.py:1642 bpython/urwid.py:612
3356
#, python-format
3457
msgid " <%s> Rewind <%s> Save <%s> Pastebin <%s> Pager <%s> Show Source "
3558
msgstr " <%s> Rewind <%s> Salva <%s> Pastebin <%s> Pager <%s> Mostra Sorgente"
@@ -131,3 +154,21 @@ msgstr ""
131154
msgid "Upload failed: Failed to recognize the helper program's output as an URL."
132155
msgstr ""
133156

157+
#: bpython/urwid.py:1108
158+
msgid "Run a reactor (see --help-reactors)."
159+
msgstr ""
160+
161+
#: bpython/urwid.py:1110
162+
msgid "List available reactors for -r."
163+
msgstr ""
164+
165+
#: bpython/urwid.py:1112
166+
msgid ""
167+
"twistd plugin to run (use twistd for a list). Use \"--\" to pass further "
168+
"options to the plugin."
169+
msgstr ""
170+
171+
#: bpython/urwid.py:1115
172+
msgid "Port to run an eval server on (forces Twisted)."
173+
msgstr ""
174+

0 commit comments

Comments
 (0)