Skip to content

Commit e5e6bd8

Browse files
committed
More translatable strings
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 5540c1d commit e5e6bd8

File tree

7 files changed

+618
-243
lines changed

7 files changed

+618
-243
lines changed

bpython/repl.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -649,12 +649,12 @@ def write2file(self):
649649
buffer to disk."""
650650

651651
try:
652-
fn = self.interact.file_prompt('Save to file (Esc to cancel): ')
652+
fn = self.interact.file_prompt(_('Save to file (Esc to cancel): '))
653653
if not fn:
654-
self.interact.notify("Save cancelled.")
654+
self.interact.notify(_('Save cancelled.'))
655655
return
656656
except ValueError:
657-
self.interact.notify("Save cancelled.")
657+
self.interact.notify(_('Save cancelled.'))
658658
return
659659

660660
if fn.startswith('~'):
@@ -664,26 +664,29 @@ def write2file(self):
664664

665665
mode = 'w'
666666
if os.path.exists(fn):
667-
mode = self.interact.file_prompt('%s already exists. Do you want '
668-
'to (c)ancel, (o)verwrite or '
669-
'(a)ppend? ' % (fn, ))
670-
if mode in ('o', 'overwrite'):
667+
mode = self.interact.file_prompt(_('%s already exists. Do you '
668+
'want to (c)ancel, '
669+
'wantch to (c)ancel, '
670+
' (o)verwrite or '
671+
'(a)ppend? ') % (fn, ))
672+
if mode in ('o', 'overwrite', _('overwrite')):
671673
mode = 'w'
672-
elif mode in ('a', 'append'):
674+
elif mode in ('a', 'append', _('append')):
673675
mode = 'a'
674676
else:
675-
self.interact.notify('Save cancelled.')
677+
self.interact.notify(_('Save cancelled.'))
676678
return
677679

678680
s = self.formatforfile(self.getstdout())
679681

680682
try:
681683
with open(fn, mode) as f:
682684
f.write(s)
683-
except IOError:
684-
self.interact.notify("Disk write error for file '%s'." % (fn, ))
685+
except IOError as e:
686+
self.interact.notify(_("Error writing file '%s': %s") % (fn,
687+
str(e)))
685688
else:
686-
self.interact.notify('Saved to %s.' % (fn, ))
689+
self.interact.notify(_('Saved to %s.') % (fn, ))
687690

688691
def copy2clipboard(self):
689692
"""Copy current content to clipboard."""
@@ -708,7 +711,7 @@ def pastebin(self, s=None):
708711

709712
if (self.config.pastebin_confirm and
710713
not self.interact.confirm(_("Pastebin buffer? (y/N) "))):
711-
self.interact.notify(_("Pastebin aborted"))
714+
self.interact.notify(_("Pastebin aborted."))
712715
return
713716
return self.do_pastebin(s)
714717

@@ -1023,15 +1026,17 @@ def edit_config(self):
10231026
with open(self.config.config_path, 'w') as f:
10241027
f.write(default_config)
10251028
except (IOError, OSError) as e:
1026-
self.interact.notify('error creating file: %r' % e)
1029+
self.interact.notify(_("Error writing file '%s': %s") % \
1030+
(self.config.config.path, str(e)))
10271031
return False
10281032
else:
10291033
return False
10301034

10311035
if self.open_in_external_editor(self.config.config_path):
1032-
self.interact.notify('bpython config file edited. Restart bpython for changes to take effect.')
1036+
self.interact.notify(_('bpython config file edited. Restart '
1037+
'bpython for changes to take effect.'))
10331038
else:
1034-
self.interact.notify('error editing config file')
1039+
self.interact.notify(_('Error editing config file.'))
10351040

10361041

10371042
def next_indentation(line, tab_length):

bpython/translations/bpython.pot

Lines changed: 92 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#, fuzzy
77
msgid ""
88
msgstr ""
9-
"Project-Id-Version: bpython 0.13-442\n"
9+
"Project-Id-Version: bpython 0.13-492\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2015-01-23 23:19+0100\n"
11+
"POT-Creation-Date: 2015-02-01 23:02+0100\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"
@@ -40,31 +40,31 @@ msgstr ""
4040
msgid "Print version and exit."
4141
msgstr ""
4242

43-
#: bpython/cli.py:321 bpython/urwid.py:555
43+
#: bpython/cli.py:318 bpython/urwid.py:555
4444
msgid "y"
4545
msgstr ""
4646

47-
#: bpython/cli.py:321 bpython/urwid.py:555
47+
#: bpython/cli.py:318 bpython/urwid.py:555
4848
msgid "yes"
4949
msgstr ""
5050

51-
#: bpython/cli.py:1696
51+
#: bpython/cli.py:1695
5252
msgid "Rewind"
5353
msgstr ""
5454

55-
#: bpython/cli.py:1697
55+
#: bpython/cli.py:1696
5656
msgid "Save"
5757
msgstr ""
5858

59-
#: bpython/cli.py:1698
59+
#: bpython/cli.py:1697
6060
msgid "Pastebin"
6161
msgstr ""
6262

63-
#: bpython/cli.py:1699
63+
#: bpython/cli.py:1698
6464
msgid "Pager"
6565
msgstr ""
6666

67-
#: bpython/cli.py:1700
67+
#: bpython/cli.py:1699
6868
msgid "Show Source"
6969
msgstr ""
7070

@@ -76,99 +76,157 @@ msgstr ""
7676
msgid "enter lines of file as though interactively typed"
7777
msgstr ""
7878

79-
#: bpython/history.py:236
79+
#: bpython/history.py:216
8080
#, python-format
8181
msgid "Error occurred while writing to file %s (%s)"
8282
msgstr ""
8383

84-
#: bpython/repl.py:477
84+
#: bpython/repl.py:513
8585
msgid "Nothing to get source of"
8686
msgstr ""
8787

88-
#: bpython/repl.py:482
88+
#: bpython/repl.py:518
8989
#, python-format
9090
msgid "Cannot get source: %s"
9191
msgstr ""
9292

93-
#: bpython/repl.py:487
93+
#: bpython/repl.py:523
9494
#, python-format
9595
msgid "Cannot access source of %r"
9696
msgstr ""
9797

98-
#: bpython/repl.py:489
98+
#: bpython/repl.py:525
9999
#, python-format
100100
msgid "No source code found for %s"
101101
msgstr ""
102102

103-
#: bpython/repl.py:655
103+
#: bpython/repl.py:652
104+
msgid "Save to file (Esc to cancel): "
105+
msgstr ""
106+
107+
#: bpython/repl.py:654 bpython/repl.py:657 bpython/repl.py:676
108+
msgid "Save cancelled."
109+
msgstr ""
110+
111+
#: bpython/repl.py:667
112+
#, python-format
113+
msgid "%s already exists. Do you want to (c)ancel, (o)verwrite or (a)ppend? "
114+
msgstr ""
115+
116+
#: bpython/repl.py:671
117+
msgid "overwrite"
118+
msgstr ""
119+
120+
#: bpython/repl.py:673
121+
msgid "append"
122+
msgstr ""
123+
124+
#: bpython/repl.py:685 bpython/repl.py:1028
125+
#, python-format
126+
msgid "Error writing file '%s': %s"
127+
msgstr ""
128+
129+
#: bpython/repl.py:688
130+
#, python-format
131+
msgid "Saved to %s."
132+
msgstr ""
133+
134+
#: bpython/repl.py:694
104135
msgid "No clipboard available."
105136
msgstr ""
106137

107-
#: bpython/repl.py:662
138+
#: bpython/repl.py:701
108139
msgid "Could not copy to clipboard."
109140
msgstr ""
110141

111-
#: bpython/repl.py:664
142+
#: bpython/repl.py:703
112143
msgid "Copied content to clipboard."
113144
msgstr ""
114145

115-
#: bpython/repl.py:673
146+
#: bpython/repl.py:712
116147
msgid "Pastebin buffer? (y/N) "
117148
msgstr ""
118149

119-
#: bpython/repl.py:674
120-
msgid "Pastebin aborted"
150+
#: bpython/repl.py:713
151+
msgid "Pastebin aborted."
121152
msgstr ""
122153

123-
#: bpython/repl.py:681
154+
#: bpython/repl.py:720
124155
#, python-format
125156
msgid "Duplicate pastebin. Previous URL: %s. Removal URL: %s"
126157
msgstr ""
127158

128-
#: bpython/repl.py:700 bpython/repl.py:728
159+
#: bpython/repl.py:739 bpython/repl.py:767
129160
msgid "Posting data to pastebin..."
130161
msgstr ""
131162

132-
#: bpython/repl.py:705
163+
#: bpython/repl.py:744
133164
#, python-format
134165
msgid "Upload failed: %s"
135166
msgstr ""
136167

137-
#: bpython/repl.py:721
168+
#: bpython/repl.py:760
138169
#, python-format
139170
msgid "Pastebin URL: %s - Removal URL: %s"
140171
msgstr ""
141172

142-
#: bpython/repl.py:740
173+
#: bpython/repl.py:779
143174
msgid "Upload failed: Helper program not found."
144175
msgstr ""
145176

146-
#: bpython/repl.py:743
177+
#: bpython/repl.py:782
147178
msgid "Upload failed: Helper program could not be run."
148179
msgstr ""
149180

150-
#: bpython/repl.py:750
181+
#: bpython/repl.py:789
151182
#, python-format
152183
msgid "Upload failed: Helper program returned non-zero exit status %s."
153184
msgstr ""
154185

155-
#: bpython/repl.py:754
186+
#: bpython/repl.py:793
156187
msgid "Upload failed: No output from helper program."
157188
msgstr ""
158189

159-
#: bpython/repl.py:761
190+
#: bpython/repl.py:800
160191
msgid "Upload failed: Failed to recognize the helper program's output as an URL."
161192
msgstr ""
162193

163-
#: bpython/repl.py:767
194+
#: bpython/repl.py:806
164195
#, python-format
165196
msgid "Pastebin URL: %s"
166197
msgstr ""
167198

168-
#: bpython/repl.py:953
199+
#: bpython/repl.py:839
200+
#, python-format
201+
msgid "Undo how many lines? (Undo will take up to ~%.1f seconds) [1]"
202+
msgstr ""
203+
204+
#: bpython/repl.py:846 bpython/repl.py:850
205+
msgid "Undo canceled"
206+
msgstr ""
207+
208+
#: bpython/repl.py:853
209+
#, python-format
210+
msgid "Undoing 1 line... (est. %.1f seconds)"
211+
msgstr ""
212+
213+
#: bpython/repl.py:856
214+
#, python-format
215+
msgid "Undoing %d lines... (est. %.1f seconds)"
216+
msgstr ""
217+
218+
#: bpython/repl.py:1018
169219
msgid "Config file does not exist - create new from default? (y/N)"
170220
msgstr ""
171221

222+
#: bpython/repl.py:1035
223+
msgid "bpython config file edited. Restart bpython for changes to take effect."
224+
msgstr ""
225+
226+
#: bpython/repl.py:1038
227+
msgid "Error editing config file."
228+
msgstr ""
229+
172230
#: bpython/urwid.py:617
173231
#, python-format
174232
msgid " <%s> Rewind <%s> Save <%s> Pastebin <%s> Pager <%s> Show Source "
@@ -196,16 +254,16 @@ msgstr ""
196254
msgid "Port to run an eval server on (forces Twisted)."
197255
msgstr ""
198256

199-
#: bpython/curtsiesfrontend/repl.py:258
257+
#: bpython/curtsiesfrontend/repl.py:259
200258
msgid "Welcome to bpython!"
201259
msgstr ""
202260

203-
#: bpython/curtsiesfrontend/repl.py:258
261+
#: bpython/curtsiesfrontend/repl.py:259
204262
#, python-format
205263
msgid "Press <%s> for help."
206264
msgstr ""
207265

208-
#: bpython/curtsiesfrontend/repl.py:470
266+
#: bpython/curtsiesfrontend/repl.py:472
209267
#, python-format
210268
msgid "Executing PYTHONSTARTUP failed: %s"
211269
msgstr ""

0 commit comments

Comments
 (0)