forked from kungming2/translator-BOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_responses.py
403 lines (323 loc) · 15.8 KB
/
_responses.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""A Python file containing most of the long-form comments and messages that all r/translator bots use."""
"""ZIWEN RESPONSES"""
# An addition to the bot footer that contains a link to check status and to unsubscribe from notifications.
MSG_UNSUBSCRIBE_BUTTON = (
" ^| ^[Points](https://www.reddit.com/message/compose?to=translator-BOT&subject=Points"
"&message=%23%23+How+many+points+have+I+earned?) ^| ^[Status](https://www.reddit.com/message/"
"compose?to=translator-BOT&subject=Status&message=%23%23+What+languages+am+I+subscribed+to?)"
" ^| ^[Unsubscribe](https://www.reddit.com/message/compose?to=translator-BOT&subject="
"Unsubscribe&message=%23%23+Please+unsubscribe+me+from+the+following+languages.%0A%23%23+"
"List+language+codes+or+names+after+the+colon+below+and+separate+languages+with+commas."
"+%28List+ALL+to+completely+unsubscribe%29%0ALANGUAGES%3A+ALL)"
)
# An addition to the notifications message about NSFW content
MSG_NSFW_WARNING = "\n\n(Just FYI, this *is* an NSFW post.)"
MSG_SUBSCRIBE_LINK = (
"https://www.reddit.com/message/compose?to=translator-BOT&subject=Subscribe&message="
"%23%23+Sign+up+for+notifications+about+new+requests+for+your+language%21%0A%23%23+List+"
"language+codes+or+names+after+the+colon+below+and+separate+languages+with+commas."
"%0A%23%23+You+can+sign+up+for+one+language+or+as+many+as+you%27d+like.%0ALANGUAGES%3A+"
)
MSG_REMOVAL_LINK = (
"https://www.reddit.com/message/compose?to=translator-BOT&subject=Unsubscribe&message="
"%23%23+Please+unsubscribe+me+from+the+following+languages.%0ALANGUAGES%3A+{language_name}"
)
MSG_NO_SUBSCRIPTIONS = (
"Sorry, you're not currently subscribed to notifications for any [language posts]"
"(https://www.reddit.com/r/translatorBOT/wiki/ziwen#wiki_language_codes.2Fnames_syntax) "
"on r/translator. Would you like to [sign up]({})?"
)
MSG_CANNOT_PROCESS = (
"Sorry, but I couldn't process the [language/language codes]"
"(https://www.reddit.com/r/translatorBOT/wiki/ziwen#wiki_language_codes.2Fnames_syntax) "
"in your message. Please double-check your message to make sure they're accurate and "
"[try again]({})."
)
MSG_PAGE = """
Hey there u/{username},
You've been paged by u/{pauthor} to take a look at a possible {language_name} request. Can you check it out?
**[{otitle}]({opermalink})** posted by *u/{oauthor}*.
Feel free to disregard the post or [message Ziwen]({removal_link}) if you wish to unsubscribe from {language_name}.
"""
MSG_MISSING_ASSETS = """
Hey there u/{oauthor},
Another community member marked **[your post]({opermalink})** as missing assets (text, images, etc) to be translated.
Please update your post with content, or delete it and resubmit it with the material you want translated.
You can re-open your translation request by commenting `!reset` on your post.
"""
MSG_TRANSLATED = """
Hey there u/{oauthor},
Another redditor on r/translator has marked **[your post]({opermalink})** as translated.
If your request has been fulfilled, please leave a comment thanking the translator!
*P.S. We encourage you to keep your post up as a useful resource for other people.*
"""
MSG_SHORT_THANKS_TRANSLATED = """
Hey there u/{0},
Thanks for submitting to r/translator! It looks like you left a short "thank you" comment on **[your post]({1})**.
Consequently, I've automatically marked your request as translated.
If this is in error, please comment `!reset` on your post or message the r/translator moderators \
[here](https://www.reddit.com/message/compose?to=r/translator&subject=Please+reset+this+post&message=\
https://www.reddit.com{1}). Thank you.
"""
MSG_NOTIFY = """
Hey there u/{username},
There's a new {language_name} {post_type}:
**[{otitle}]({opermalink})** posted by u/{oauthor}.
"""
MSG_NOTIFY_IDENTIFY = """
Hey there u/{username},
A {post_type} has been newly identified as {language_name}:
**[{otitle}]({opermalink})** posted by u/{oauthor}.
"""
MSG_WIKIPAGE_FULL = (
"The [{0} wiki page](https://www.reddit.com/r/translatorBOT/wiki/{0}) seems to be full. "
"Please archive some of the older entries on that page."
)
MSG_NO_POINTS = (
"You haven't earned any points on r/translator yet. "
"You can earn points by helping identify or translate requests in our community!"
)
MSG_LANGUAGE_FREQUENCY = (
"For your reference, our [statistics](https://www.reddit.com/r/translator/wiki/{})"
" indicate that approximately **{} requests are made per {}** for {}."
)
MSG_SUBSCRIBE = (
"{}! You have been subscribed to r/translator notifications for:\n\n* {}"
"\n\nFor your reference, here are some statistics on the estimated frequency of "
"requests for those language(s):\n\n{}\n\n"
"To see all your subscribed notifications, please click the 'Status' link below."
)
MSG_UNSUBSCRIBE_ALL = (
"You have been unsubscribed from r/translator notifications for:\n\n* {} \n\n"
"To resubscribe, please [click here]({})."
)
MSG_RESTORE_LINK_FAIL = "Sorry, but due to Reddit limitations the `!restore` function only works with text posts."
MSG_RESTORE_NOT_ELIGIBLE = (
"Sorry, but your username does not appear on the list of translators and/or notified "
"individuals for this post. If you had previously made a translation, please mark it as "
"translated with the `!translated` command, and then try again."
)
MSG_RESTORE_TEXT_FAIL = "Sorry, but I couldn't find any data on [Pushshift](https://pushshift.io/) for [this post]({})."
MSG_RESTORE_TEXT_TEMPLATE = """
*The following text was retrieved for [this post]({}) using data from [Pushshift](https://pushshift.io/)*:
---
{}
"""
# A comment that is added to long YouTube videos or long text posts.
COMMENT_LONG = (
"**Your translation request appears to be very long.** "
"It may take a while for a translator to respond. "
"Consider narrowing the scope of your request or asking for a synopsis or summary instead.\n\n*Note: "
"Your post has NOT been removed. "
"This is merely an automated advisory notice and no action is required on your part.*"
)
# A comment that is added to new accounts who attempt to use !page.
COMMENT_PAGE_DISALLOWED = (
"Hey, u/{pauthor}, thanks for using my paging service. "
"However, your account needs to be 14 days or older to use the service."
)
COMMENT_NO_LANGUAGE = (
"Hey, u/{pauthor}, thanks for using my paging service. Unfortunately, we don't have anyone on "
"file for {language_name}.\n\nIf someone else is reading this and knows {language_name}, please "
"[sign up for notifications for that language](https://www.reddit.com/message/compose?to="
"translator-BOT&subject=Subscribe&message=%23%23+Sign+up+for+notifications+about+new+requests+"
"for+your+language%21%0ALANGUAGES%3A+{language_code}) "
"if you would like to be notified for future posts for it!"
)
COMMENT_NO_RESULTS = "Sorry, but that doesn't look like anything to me."
# A comment that is posted when someone attempts to call the bot on r/translation.
COMMENT_R_TRANSLATION = (
"Hey there u/{pauthor}, it looks like you tried to call me on r/translation. "
"Unfortunately, I can only process user commands over at r/translator."
)
COMMENT_ENGLISH_ONLY = """
Hey there u/{oauthor},
* Your post above has been automatically removed because does not appear to be a request for a translation.
There are more focused communities for English-only requests.
---
**Our Recommendations**
* Answers on English language learning, English video transcriptions, or word explanations: **r/EnglishLearning** or \
**r/Grammar**
* Proofreading of written English content: **r/Proofreading** (please note their sidebar rules for submissions.)
* Decipherment of illegible handwriting: **r/handwriting**
* If you're requesting the *review of a translation*, please include the source language name and its original text \
in your resubmitted post to r/translator.
"""
COMMENT_BAD_TITLE = """
Hey there, u/{author}!
We're happy to help you translate your request, but this post has been automatically removed because:
* It appears that the title is not properly formatted according to our subreddit's guidelines.
* Proper title formatting helps keep our community organized and allows our translators to access relevant requests.
---
**What should you do now?**
* [Try resubmitting your request with the suggested title text below]\
(https://www.reddit.com/r/translator/submit?title={new_url}):
* {new_title}
* Should you need more information, please read r/translator's [formatting guidelines]\
(https://www.reddit.com/r/translator/wiki/request-guidelines#wiki_how_should_i_submit_requests_for_translations.3F).
"""
COMMENT_CLAIM = """
**Claimer:** u/{claimer} at {time} UTC
*The user above has indicated that they are working on a translation for this {language_name} request.*
*This post will revert to an unclaimed state if it is not marked as 'Needs Review' or 'Translated' within 8 hours.*
"""
COMMENT_CURRENTLY_CLAIMED = """
This post has already been claimed by u/{claimer_name}. Their in-progress claim will expire in {remaining_time}.
"""
COMMENT_UNKNOWN = """
**It looks like you have submitted a translation request tagged as 'Unknown.'**
* Other community members may help you recategorize your post with the `!identify:` or the `!page:` commands.
* Please refrain from posting short 'thank you' comments until your request has been fully translated.
* Do *not* delete your post if it is identified as another language. We will automatically find people who can help you!
*Note: Your post has NOT been removed. This is merely an automated advisory notice.*
"""
COMMENT_DEFINED_MULTIPLE = """
**It looks like you have submitted a translation request for multiple defined languages.**
* Translators can use the `!translated` and `!doublecheck` status commands on this post by including the \
language name and command in their comment.
* For example, if one is making a French translation, please include `French` and the command in the text.
* This post's flair will automatically update to reflect the state of its requested languages.
*Note: Your post has NOT been removed. This is merely an automated advisory notice.*
"""
COMMENT_ADVANCED_IDENTIFY_ERROR = """
Sorry, but [advanced *!identify* commands](https://www.reddit.com/r/translatorBOT/wiki/ziwen#wiki_advanced_.21identify)\
require either a [three-letter ISO 639-3](https://en.wikipedia.org/wiki/List_of_ISO_639-3_codes) or \
[four-letter ISO 15924 code](https://en.wikipedia.org/wiki/ISO_15924#List_of_codes).
Here are some common ISO 15924 codes:
Script | Code
-------|-----
Arabic | *Arab*
Cyrillic | *Cyrl*
Devanagari | *Deva*
Han Characters | *Hani*
Hebrew | *Hebr*
Latin | *Latn*
Nastaliq | *Aran*
"""
COMMENT_VERIFICATION_RESPONSE = (
"{}, u/{}. I've taken note of your verification request."
)
COMMENT_REFERENCE_HEADER = (
"*Another member of our community has identified your translation request as:*\n\n"
)
COMMENT_INVALID_REFERENCE = (
"Sorry, but that doesn't look like anything to me. "
"Please enter a valid ISO 639-1 code, ISO 639-3 code, or language name to look up."
)
COMMENT_INVALID_CODE = (
"Sorry, but `{0}` doesn't look like anything to me. Would you like to [send my creator a "
"message about it?](https://www.reddit.com/message/compose?to=%2Fr%2FtranslatorBOT&subject="
"Identification+for+'{0}'&message=%5BPlease+check+this+out+%5D%28{1}%29%21)"
)
COMMENT_INVALID_SCRIPT = (
"Sorry, but the script code `{}` doesn't look like anything to me. Please "
"[see here](https://en.wikipedia.org/wiki/ISO_15924#List_of_codes) for a list of "
"valid ISO 15924 codes."
)
COMMENT_INVALID_ZH_CHARACTER = (
"**There were no results for {}**. Please check to make sure it is a valid Chinese "
"character. Alternatively, it may be an uncommon variant that is not in "
"online dictionaries."
)
REFERENCE_TEMPLATE_MAIN = """## [{0}](https://www.ethnologue.com/language/{1})
**Language Name**: {0}
{2}{3}
**ISO 639-3 Code**: {1}
**Alternate Names**: {4}
**Population**: {5}
**Location**: {6}; {7}
**Classification**: {8}
**Writing system**: {9}
**[Wikipedia Entry]({10})**:
> {11}
^Information ^from ^[Ethnologue](https://www.ethnologue.com/language/{1}) ^| \
^[Glottolog](http://glottolog.org/glottolog?iso={1}) ^| ^[MultiTree](http://multitree.org/codes/{1}.html) ^| \
^[ScriptSource](http://scriptsource.org/cms/scripts/page.php?item_id=language_detail&key={1}) ^| ^[Wikipedia]({10})
"""
REFERENCE_TEMPLATE_OTHER = """## [{0}](https://www.multitree.org/codes/{1})
**Language Name**: {0}
**ISO 639-3 Code**: {1}
**Alternate Names**: {2}
**Classification**: {3}
**[Wikipedia Entry]({4})**:
> {5}
^Information ^from ^[MultiTree](http://multitree.org/codes/{1}.html) ^| \
^[Glottolog](http://glottolog.org/glottolog?iso={1}) ^| \
^[ScriptSource](http://scriptsource.org/cms/scripts/page.php?item_id=language_detail&key={1}) ^| ^[Wikipedia]({4})
"""
"""WENYUAN RESPONSES"""
WY_THREAD_BODY = """
Here are the posts from the last week still marked as "Unknown." Please help identify them if you can!
Date | Title | Author
:----|---------------|--------
{unknown_content}
*Please make any identifications on the individual request pages.*
"""
WY_MOD_NOTIFICATION_MESSAGE = """
##### Routine Tasks
Task | Status
------|-------
[Status Update](https://www.reddit.com/r/translatorBOT/wiki/status) | {}
File Backup | {}
##### Operations
{}
{}
##### Status Summary
{}
---
###### Completed in {}.
"""
WY_NEW_HEADER = """
## {language_name} ({language_family}) 
*[Statistics](https://www.reddit.com/r/translator/wiki/statistics) for r/translator \
provided by [Wenyuan](https://www.reddit.com/r/translatorBOT/wiki/wenyuan)*
Year | Month | Total Requests | Percent of All Requests | Untranslated Requests | Translation Percentage | \
RI | View Translated Requests
-----|-------|------|------|------|------|----|------"""
WY_STATUS_UPDATE = """
### Due to {reason}, the bot will be down until around:
# [{utc_time} UTC](https://www.timeanddate.com/worldclock/fixedtime.html?iso={url_time}&msg=Ziwen+will+be+back+at+...)
During this time period the command monitoring, reference lookup, and crossposting functions will not be available.
This status post will be deleted when the bot is back online. Thanks for your patience!
"""
WY_FULL_RETRIEVAL_DATA = """
Info | #
----------------------------------------|-----------
Total number of processed posts | {} posts
Number of non-supported CSS posts | {} posts
Number of regional language posts | {} posts
Number of problematic posts | {} posts
Overall accuracy | {}%
Supported posts percentage | {}%
Average processing time per post | {} seconds
Total elapsed time | {} seconds
"""
"""ZIWEN STREAMER RESPONSES"""
ZWS_COMMENT_XPOST = """
**OP:** u/{original_author} at r/{subreddit} ([Link]({cpermalink}))
**Requester:** u/{requester}
*This is a crossposted translation request and all images/text remain © of the OP. Either user listed above can \
comment* `!delete` *to remove this post if they wish.*
*Please post any translations or commands here on r/translator.*
"""
ZWS_COMMENT_ALREADY_POSTED = (
"It appears that this link has already been posted as a translation request."
)
ZWS_COMMENT_XPOST_THANKS = (
"{}. I've [crossposted](https://www.reddit.com/r/translatorBOT/wiki/ziwen#"
"wiki_cross-posting) this link as a [{} translation request here]({})."
)
ZWS_COMMENT_WRONG_SUBREDDIT = (
"Sorry, but r/translate is inactive. Did you mean r/translator?\n\n"
"^(Note: I can't detect ninja edits.)"
)
ZWS_COMMENT_ENGLISH_ONLY = (
'It appears that this is an English-only "translation" crosspost request. English-only '
"posts are better suited for r/EnglishLearning."
)
ZWS_COMMENT_WRONG_XPOST_COMMENT = (
"It appears that you're trying to crosspost a comment for translation, but your "
"command is in reply to a submission."
)