Skip to content

Commit 6661984

Browse files
DeuchnordDamgermys
authored andcommitted
fix: fix English messages (#178)
Co-authored-by: Damgermys <damhub28@gmail.com> Co-authored-by: Damgermys <damhub28@gmail.com>
1 parent b3527d0 commit 6661984

File tree

5 files changed

+96
-81
lines changed

5 files changed

+96
-81
lines changed

_kosmorro/dumper.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import subprocess
2525
import shutil
2626
from pathlib import Path
27+
28+
from kosmorrolib.exceptions import UnavailableFeatureError
2729
from tabulate import tabulate
2830
from termcolor import colored
2931

@@ -290,7 +292,7 @@ def add_strings(
290292
) -> str:
291293
document = document.replace("+++KOSMORRO-VERSION+++", version)
292294
document = document.replace("+++KOSMORRO-LOGO+++", kosmorro_logo_path)
293-
document = document.replace("+++DOCUMENT-TITLE+++", _("A Summary of your Sky"))
295+
document = document.replace("+++DOCUMENT-TITLE+++", _("Overview of your sky"))
294296
document = document.replace(
295297
"+++DOCUMENT-DATE+++", self.get_date_as_string(capitalized=True)
296298
)
@@ -474,14 +476,13 @@ def to_string(self):
474476
)
475477
return self._compile(latex_dumper.to_string())
476478
except RuntimeError as error:
477-
raise error
478-
# raise UnavailableFeatureError(
479-
# _(
480-
# "Building PDFs was not possible, because some dependencies are not"
481-
# " installed.\nPlease look at the documentation at http://kosmorro.space "
482-
# "for more information."
483-
# )
484-
# ) from error
479+
raise UnavailableFeatureError(
480+
_(
481+
"Building PDF was not possible, because some dependencies are not"
482+
" installed.\nPlease look at the documentation at http://kosmorro.space "
483+
"for more information."
484+
)
485+
) from error
485486

486487
@staticmethod
487488
def is_file_output_needed() -> bool:
@@ -515,7 +516,7 @@ def _compile(latex_input) -> bytes:
515516

516517
raise CompileError(
517518
_(
518-
"An error occured during the compilation of the PDF.\n"
519+
"An error occurred during the compilation of the PDF.\n"
519520
"Please open an issue at https://github.com/Kosmorro/kosmorro/issues and share "
520521
"the content of the log file at /tmp/kosmorro-%s.log"
521522
% timestamp

_kosmorro/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self, min_date: date, max_date: date):
3232
self.min_date = min_date
3333
self.max_date = max_date
3434
self.msg = _(
35-
"The date must be between {minimum_date}" " and {maximum_date}"
35+
"The date must be between {minimum_date} and {maximum_date}"
3636
).format(
3737
minimum_date=min_date.strftime(SHORT_DATE_FORMAT),
3838
maximum_date=max_date.strftime(SHORT_DATE_FORMAT),

_kosmorro/i18n/strings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def from_event(event: Event) -> str:
1010
EventType.OPPOSITION: _("%s is in opposition"),
1111
EventType.CONJUNCTION: _("%s and %s are in conjunction"),
1212
EventType.OCCULTATION: _("%s occults %s"),
13-
EventType.MAXIMAL_ELONGATION: _("%s's largest elongation"),
13+
EventType.MAXIMAL_ELONGATION: _("Elongation of %s is maximal"),
1414
EventType.MOON_PERIGEE: _("%s is at its perigee"),
1515
EventType.MOON_APOGEE: _("%s is at its apogee"),
1616
}.get(event.event_type) % tuple([from_object(o.identifier) for o in event.objects])

_kosmorro/locales/messages.pot

Lines changed: 58 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: kosmorro 0.9.0\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2021-05-12 12:05+0200\n"
11+
"POT-Creation-Date: 2021-05-15 16:28+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"
@@ -27,79 +27,87 @@ msgid ""
2727
"offset format."
2828
msgstr ""
2929

30-
#: _kosmorro/dumper.py:106
30+
#: _kosmorro/dumper.py:108
3131
msgid "Expected events:"
3232
msgstr ""
3333

34-
#: _kosmorro/dumper.py:113
34+
#: _kosmorro/dumper.py:115
3535
msgid "Note: All the hours are given in UTC."
3636
msgstr ""
3737

38-
#: _kosmorro/dumper.py:120
38+
#: _kosmorro/dumper.py:122
3939
msgid "Note: All the hours are given in the UTC{offset} timezone."
4040
msgstr ""
4141

42-
#: _kosmorro/dumper.py:184 _kosmorro/dumper.py:320
42+
#: _kosmorro/dumper.py:186 _kosmorro/dumper.py:322
4343
msgid "Object"
4444
msgstr ""
4545

46-
#: _kosmorro/dumper.py:185 _kosmorro/dumper.py:321
46+
#: _kosmorro/dumper.py:187 _kosmorro/dumper.py:323
4747
msgid "Rise time"
4848
msgstr ""
4949

50-
#: _kosmorro/dumper.py:186 _kosmorro/dumper.py:323
50+
#: _kosmorro/dumper.py:188 _kosmorro/dumper.py:325
5151
msgid "Culmination time"
5252
msgstr ""
5353

54-
#: _kosmorro/dumper.py:187 _kosmorro/dumper.py:325
54+
#: _kosmorro/dumper.py:189 _kosmorro/dumper.py:327
5555
msgid "Set time"
5656
msgstr ""
5757

58-
#: _kosmorro/dumper.py:221
58+
#: _kosmorro/dumper.py:223
5959
msgid "Moon phase is unavailable for this date."
6060
msgstr ""
6161

62-
#: _kosmorro/dumper.py:225 _kosmorro/dumper.py:329
62+
#: _kosmorro/dumper.py:227 _kosmorro/dumper.py:331
6363
msgid "Moon phase:"
6464
msgstr ""
6565

66-
#: _kosmorro/dumper.py:229
66+
#: _kosmorro/dumper.py:231
6767
msgid "{next_moon_phase} on {next_moon_phase_date} at {next_moon_phase_time}"
6868
msgstr ""
6969

70-
#: _kosmorro/dumper.py:293
71-
msgid "A Summary of your Sky"
70+
#: _kosmorro/dumper.py:295
71+
msgid "Overview of your sky"
7272
msgstr ""
7373

74-
#: _kosmorro/dumper.py:301
74+
#: _kosmorro/dumper.py:303
7575
msgid ""
7676
"This document summarizes the ephemerides and the events of {date}. It "
7777
"aims to help you to prepare your observation session. All the hours are "
7878
"given in {timezone}."
7979
msgstr ""
8080

81-
#: _kosmorro/dumper.py:311
81+
#: _kosmorro/dumper.py:313
8282
msgid ""
8383
"Don't forget to check the weather forecast before you go out with your "
8484
"equipment."
8585
msgstr ""
8686

87-
#: _kosmorro/dumper.py:318
87+
#: _kosmorro/dumper.py:320
8888
msgid "Ephemerides of the day"
8989
msgstr ""
9090

91-
#: _kosmorro/dumper.py:327
91+
#: _kosmorro/dumper.py:329
9292
msgid "hours"
9393
msgstr ""
9494

95-
#: _kosmorro/dumper.py:334
95+
#: _kosmorro/dumper.py:336
9696
msgid "Expected events"
9797
msgstr ""
9898

99-
#: _kosmorro/dumper.py:517
99+
#: _kosmorro/dumper.py:480
100+
msgid ""
101+
"Building PDF was not possible, because some dependencies are not "
102+
"installed.\n"
103+
"Please look at the documentation at http://kosmorro.space for more "
104+
"information."
105+
msgstr ""
106+
107+
#: _kosmorro/dumper.py:518
100108
#, python-format
101109
msgid ""
102-
"An error occured during the compilation of the PDF.\n"
110+
"An error occurred during the compilation of the PDF.\n"
103111
"Please open an issue at https://github.com/Kosmorro/kosmorro/issues and "
104112
"share the content of the log file at /tmp/kosmorro-%s.log"
105113
msgstr ""
@@ -111,107 +119,107 @@ msgstr ""
111119
#: _kosmorro/main.py:62
112120
msgid ""
113121
"Save the planet and paper!\n"
114-
"Consider printing you PDF document only if really necessary, and use the "
115-
"other side of the sheet."
122+
"Consider printing your PDF document only if really necessary, and use the"
123+
" other side of the sheet."
116124
msgstr ""
117125

118126
#: _kosmorro/main.py:71
119127
msgid ""
120128
"PDF output will not contain the ephemerides, because you didn't provide "
121-
"the observation coordinate."
129+
"the observation coordinates."
122130
msgstr ""
123131

124132
#: _kosmorro/main.py:116
125-
msgid "Could not save the output in \"{path}\": {error}"
133+
msgid "The file could not be saved in \"{path}\": {error}"
126134
msgstr ""
127135

128136
#: _kosmorro/main.py:130
129-
msgid "Selected output format needs an output file (--output)."
137+
msgid "Please provide a file path to export in this format (--output)."
130138
msgstr ""
131139

132-
#: _kosmorro/main.py:158
140+
#: _kosmorro/main.py:163
133141
msgid "Moon phase can only be displayed between {min_date} and {max_date}"
134142
msgstr ""
135143

136-
#: _kosmorro/main.py:195
144+
#: _kosmorro/main.py:202
137145
msgid "Running on Python {python_version} with Kosmorrolib v{kosmorrolib_version}"
138146
msgstr ""
139147

140-
#: _kosmorro/main.py:205
148+
#: _kosmorro/main.py:212
141149
msgid "Do you really want to clear Kosmorro's cache? [yN] "
142150
msgstr ""
143151

144-
#: _kosmorro/main.py:213
145-
msgid "Answer did not match expected options, cache not cleared."
152+
#: _kosmorro/main.py:220
153+
msgid "Incorrect answer, cache not cleared."
146154
msgstr ""
147155

148-
#: _kosmorro/main.py:223
156+
#: _kosmorro/main.py:230
149157
msgid ""
150-
"Compute the ephemerides and the events for a given date, at a given "
158+
"Compute the ephemerides and the events for a given date and a given "
151159
"position on Earth."
152160
msgstr ""
153161

154-
#: _kosmorro/main.py:227
162+
#: _kosmorro/main.py:233
155163
msgid ""
156164
"By default, only the events will be computed for today ({date}).\n"
157165
"To compute also the ephemerides, latitude and longitude arguments are "
158166
"needed."
159167
msgstr ""
160168

161-
#: _kosmorro/main.py:241
169+
#: _kosmorro/main.py:247
162170
msgid "Show the program version"
163171
msgstr ""
164172

165-
#: _kosmorro/main.py:249
166-
msgid "Delete all the files Kosmorro stored in the cache."
173+
#: _kosmorro/main.py:255
174+
msgid "Delete all the files from Kosmorro's cache."
167175
msgstr ""
168176

169-
#: _kosmorro/main.py:257
170-
msgid "The format under which the information have to be output"
177+
#: _kosmorro/main.py:263
178+
msgid "The format to output the information to"
171179
msgstr ""
172180

173-
#: _kosmorro/main.py:264
181+
#: _kosmorro/main.py:270
174182
msgid ""
175183
"The observer's latitude on Earth. Can also be set in the "
176184
"KOSMORRO_LATITUDE environment variable."
177185
msgstr ""
178186

179-
#: _kosmorro/main.py:274
187+
#: _kosmorro/main.py:280
180188
msgid ""
181189
"The observer's longitude on Earth. Can also be set in the "
182190
"KOSMORRO_LONGITUDE environment variable."
183191
msgstr ""
184192

185-
#: _kosmorro/main.py:284
193+
#: _kosmorro/main.py:290
186194
msgid ""
187-
"The date for which the ephemerides must be computed (in the YYYY-MM-DD "
188-
"format), or as an interval in the \"[+-]YyMmDd\" format (with Y, M, and D"
189-
" numbers). Defaults to the current date ({default_date})"
195+
"The date for which the ephemerides must be calculated. Can be in the "
196+
"YYYY-MM-DD format or an interval in the \"[+-]YyMmDd\" format (with Y, M,"
197+
" and D numbers). Defaults to today ({default_date})."
190198
msgstr ""
191199

192-
#: _kosmorro/main.py:295
200+
#: _kosmorro/main.py:301
193201
msgid ""
194202
"The timezone to display the hours in (e.g. 2 for UTC+2 or -3 for UTC-3). "
195203
"Can also be set in the KOSMORRO_TIMEZONE environment variable."
196204
msgstr ""
197205

198-
#: _kosmorro/main.py:304
206+
#: _kosmorro/main.py:310
199207
msgid "Disable the colors in the console."
200208
msgstr ""
201209

202-
#: _kosmorro/main.py:311
210+
#: _kosmorro/main.py:317
203211
msgid ""
204212
"A file to export the output to. If not given, the standard output is "
205213
"used. This argument is needed for PDF format."
206214
msgstr ""
207215

208-
#: _kosmorro/main.py:320
216+
#: _kosmorro/main.py:326
209217
msgid ""
210218
"Do not generate a graph to represent the rise and set times in the PDF "
211219
"format."
212220
msgstr ""
213221

214-
#: _kosmorro/main.py:328
222+
#: _kosmorro/main.py:334
215223
msgid "Show debugging messages"
216224
msgstr ""
217225

@@ -232,7 +240,7 @@ msgstr ""
232240

233241
#: _kosmorro/i18n/strings.py:13
234242
#, python-format
235-
msgid "%s's largest elongation"
243+
msgid "Elongation of %s is maximal"
236244
msgstr ""
237245

238246
#: _kosmorro/i18n/strings.py:14

0 commit comments

Comments
 (0)