Repository navigation
Expand file tree
/
Copy pathlocalization.py
More file actions
304 lines (302 loc) · 16.1 KB
/
Copy pathlocalization.py
File metadata and controls
304 lines (302 loc) · 16.1 KB
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
import config
stringsMap = {
"vi": {
"text": "Văn bản",
"image": "Ảnh",
"gif": "Ảnh động GIF",
"video": "Video",
"attachment": "Tệp đính kèm",
"textMedia": "Văn bản & Media ({mediaStr})",
"mediaOnly": "Media ({mediaStr})",
"msgDeletedOffline": "Tin nhắn bị xóa (Offline)",
"msgDeleted": "Tin nhắn bị xóa",
"author": "Người gửi",
"channel": "Kênh",
"sentTime": "Thời gian gửi",
"replyTo": "Phản hồi đến tin nhắn ID",
"noDbContent": "[Không tìm thấy nội dung trong DB]",
"noTextContent": "[Không có nội dung chữ hoặc chứa Media]",
"msgType": "Loại tin nhắn",
"content": "Nội dung",
"noText": "```\n[Không có nội dung chữ]\n```",
"sysWarning": "Cảnh báo hệ thống",
"fileSizeError": "Tệp `{filename}` vượt quá dung lượng cho phép của máy chủ, bỏ qua tải lên.",
"bulkReportHeader": "=== BÁO CÁO XÓA TIN NHẮN HÀNG LOẠT - KÊNH {channelId} ===",
"bulkReason": "Nguyên nhân xác định: {reason}",
"bulkDetectTime": "Thời gian phát hiện: {time}",
"bulkMsgAuthor": "[{time}] ID Tác giả: {authorId} | Tên: {name}",
"bulkMsgId": "ID Tin nhắn: {id}",
"bulkMsgContent": "Nội dung: {content}",
"bulkTitle": "Phát hiện Xóa Tin nhắn Hàng loạt",
"bulkDesc": "Ghi nhận tổng cộng **{count}** tin nhắn bị xóa đồng thời tại kênh <#{channelId}>.\nNguồn xác thực: **{reason}**.\nChi tiết toàn bộ tin nhắn được tổng hợp bên trong tệp văn bản.",
"msgEdited": "Tin nhắn bị chỉnh sửa",
"beforeEdit": "Trước khi sửa",
"afterEdit": "Sau khi sửa",
"empty": "[Trống]",
"progressStr": "\rĐã nạp: {count} tin nhắn | Tốc độ: {speed:.2f} tin nhắn/giây",
"scanCompleteStr": "Hoàn tất nạp {count} tin nhắn trong {time} giây",
"ramUsageStr": "Mức sử dụng RAM: {ram:.2f} MB",
"oldestMsgStr": "Thời gian tin nhắn cũ nhất đã quét: {date}",
"botUsername": "Bot Username: {name}",
"botId": "Bot ID: {id}",
"reportSched": "Chế độ báo cáo định kỳ: {sched}",
"sendReportLog": "Gửi báo cáo vào kênh log: {status}",
"dbSuccess": "Trạng thái Database: Kết nối thành công",
"dbFail": "Trạng thái Database: Kết nối thất bại",
"dbSize": "Kích thước tệp Database: {size}",
"monitoredChannels": "Số lượng kênh đang giám sát: {count}",
"totalMembers": "Tổng số người trong máy chủ: {count}",
"syncSlash": "Đã đồng bộ Slash Command thành công",
"purgeReason": "Purge bởi Tác giả: {name} ({id})",
"bulkUnknown": "Bulk Delete (Unknown)",
"watchdogStagnation": "Watchdog detected task stagnation or crash: {name}! Safe reconstruction in progress...",
"watchdogDeath": "Watchdog detected death in critical component: {name}! Resurrecting system loops...",
"yes": "Có",
"no": "Không",
"botStarting": "MACB đang khởi động...",
"shuttingDown": "Đang tiến hành tắt hệ thống an toàn...",
"shutdownComplete": "Hệ thống đóng an toàn.",
"statsTitle": "Trạng thái của MACB",
"genStats": "Thống kê Chung",
"uptimeStr": "{d} ngày, {h} giờ, {m} phút, {s} giây",
"botInfo": "Thông tin Bot",
"dbSection": "Cơ sở dữ liệu",
"dbStatus": "Trạng thái",
"dbFileSize": "Kích thước tệp",
"loadedMsgs": "Tin nhắn đã nạp",
"scanTimeField": "Thời gian quét",
"oldestMsgField": "Tin nhắn cũ nhất",
"serverStats": "Thống kê máy chủ",
"monitoredChannelsField": "Kênh giám sát",
"totalMembersField": "Tổng thành viên",
"resourcesSection": "Tài nguyên",
"ramUsageField": "RAM đang dùng",
"supportDiscord": "Discord Hỗ trợ",
"periodicReportHourly": "Báo cáo định kỳ (hàng giờ)",
"periodicReportDaily": "Báo cáo định kỳ (hàng ngày)",
"publishTime": "Thời gian phát hành",
"totalCurrentMessages": "Tổng số tin nhắn hiện tại",
"newMessagesGenerated": "Tin nhắn mới phát sinh",
"editedMessagesField": "Tin nhắn đã chỉnh sửa",
"deletedMessagesField": "Tin nhắn đã xóa",
"msgCountSuffix": "{count} tin nhắn",
"loadingDbFirst": "Đang nạp dữ liệu tin nhắn vào database lần đầu... (quá trình này có thể mất vài giây hoặc vài phút).",
"loadingDbSync": "Đang kiểm tra và đồng bộ dữ liệu tin nhắn với máy chủ... (quá trình này có thể mất vài giây hoặc vài phút).",
"channelsProgressStr": "\rKênh: {completed}/{total} | Đã xử lý: {count} tin nhắn | Tốc độ: {speed:.2f} tin nhắn/giây",
"scanCompleteFirstStr": "Hoàn tất nạp {count} tin nhắn vào database trong {time} giây",
"scanCompleteSyncStr": "Hoàn tất đồng bộ {count} tin nhắn trong {time} giây",
"oldestMsgStr": "Thời gian tin nhắn cũ nhất: {date}",
"statsDescription": "Xem thống kê vận hành của MACB",
"healthDescription": "Xem tình trạng runtime chi tiết của MACB",
"reportDescription": "Tạo và gửi báo cáo MACB ngay",
"generalSection": "Tổng quan",
"activitySection": "Hoạt động",
"startupScanSection": "Quét khi khởi động",
"runtimeSection": "Runtime",
"healthTitle": "Sức khỏe MACB",
"heartbeatsSection": "Heartbeat",
"tasksSection": "Task",
"queuesSection": "Hàng đợi",
"latencySection": "Độ trễ",
"uptimeField": "Thời gian chạy",
"botField": "Bot",
"scheduleField": "Lịch báo cáo",
"watchdogField": "Watchdog",
"queueField": "Hàng đợi",
"logQueueField": "Hàng đợi log",
"newField": "Mới",
"editedField": "Đã sửa",
"deletedField": "Đã xóa",
"progressField": "Tiến độ",
"bootScannedField": "Đã quét lúc khởi động",
"retriesField": "Thử lại",
"droppedField": "Đã bỏ",
"throughputField": "Thông lượng",
"healthyStatus": "Ổn định",
"warningStatus": "Cảnh báo",
"okStatus": "OK",
"staleStatus": "Cũ",
"noHeartbeatStatus": "chưa có heartbeat",
"taskMissing": "thiếu",
"taskCancelled": "đã hủy",
"taskStopped": "đã dừng",
"taskRunning": "đang chạy",
"metricsTaskField": "Metrics",
"periodicReportTaskField": "Báo cáo định kỳ",
"databaseWorkerField": "Database worker",
"mediaCacheTaskField": "Cache media",
"logWorkersField": "Log workers",
"sendLatencyField": "Độ trễ gửi",
"downloadLatencyField": "Độ trễ tải",
"databaseShortField": "Database",
"logShortField": "Log",
"reportPermissionDenied": "Bạn cần quyền Quản lý máy chủ để dùng lệnh này.",
"reportSent": "Đã gửi báo cáo vào <#{channelId}>.",
"reportFailed": "Gửi báo cáo thất bại. Hãy kiểm tra log bot và quyền kênh log.",
"statsFooter": "Bot by @meowice | Source: github.com/MeowIce/macb",
"secondsSuffix": "{value} giây",
"heartbeatAgeSuffix": "{value:.1f} giây trước",
"reportScheduleHourlyValue": "hàng giờ",
"reportScheduleDailyValue": "hàng ngày",
"replayDescription": "Gửi lại các tin nhắn log trong Dead Letter Queue",
"replaySuccess": "Đã gửi lại thành công {count} dead letters.",
"replayEmpty": "Không có dead letters nào cần gửi lại.",
"reportTypeManual": "Thủ công (Slash Command)",
"reportTypeScheduled": "Tự động (Lịch định kỳ)",
"reportTypeField": "Phương thức phát hành",
"botStatus": "{count:,} tin nhắn",
"botStatusSyncing": "Đang đồng bộ tin nhắn",
},
"en": {
"text": "Text",
"image": "Image",
"gif": "Animated GIF",
"video": "Video",
"attachment": "Attachment",
"textMedia": "Text & Media ({mediaStr})",
"mediaOnly": "Media ({mediaStr})",
"msgDeletedOffline": "Message Deleted (Offline)",
"msgDeleted": "Message Deleted",
"author": "Sender",
"channel": "Channel",
"sentTime": "Sent Time",
"replyTo": "Replying to message ID",
"noDbContent": "[Content not found in DB]",
"noTextContent": "[No text content or contains Media]",
"msgType": "Message Type",
"content": "Content",
"noText": "```\n[No text content]\n```",
"sysWarning": "System Warning",
"fileSizeError": "File `{filename}` exceeds server payload limit, skipping upload.",
"bulkReportHeader": "=== BULK DELETE REPORT - CHANNEL {channelId} ===",
"bulkReason": "Identified Reason: {reason}",
"bulkDetectTime": "Detection Time: {time}",
"bulkMsgAuthor": "[{time}] Author ID: {authorId} | Name: {name}",
"bulkMsgId": "Message ID: {id}",
"bulkMsgContent": "Content: {content}",
"bulkTitle": "Bulk Delete Detected",
"bulkDesc": "Recorded a total of **{count}** messages deleted simultaneously in channel <#{channelId}>.\nVerification source: **{reason}**.\nFull details of messages are compiled inside the text file.",
"msgEdited": "Message Edited",
"beforeEdit": "Before Edit",
"afterEdit": "After Edit",
"empty": "[Empty]",
"progressStr": "\nLoaded: {count} messages | Speed: {speed:.2f} messages/sec",
"scanCompleteStr": "Completed loading {count} messages in {time} seconds",
"ramUsageStr": "RAM Usage: {ram:.2f} MB",
"oldestMsgStr": "Oldest scanned message time: {date}",
"botUsername": "Bot Username: {name}",
"botId": "Bot ID: {id}",
"reportSched": "Periodic report mode: {sched}",
"sendReportLog": "Send report to log channel: {status}",
"dbSuccess": "Database Status: Connection Successful",
"dbFail": "Database Status: Connection Failed",
"dbSize": "Database File Size: {size}",
"monitoredChannels": "Number of monitored channels: {count}",
"totalMembers": "Total server members: {count}",
"syncSlash": "Successfully synced Slash Commands",
"purgeReason": "Purge by Author: {name} ({id})",
"bulkUnknown": "Bulk Delete (Unknown)",
"watchdogStagnation": "Watchdog detected task stagnation or crash: {name}! Safe reconstruction in progress...",
"watchdogDeath": "Watchdog detected death in critical component: {name}! Resurrecting system loops...",
"yes": "Yes",
"no": "No",
"botStarting": "MACB is starting...",
"shuttingDown": "Safe shutdown in progress...",
"shutdownComplete": "System closed safely.",
"statsTitle": "MACB Status",
"genStats": "General Statistics",
"uptimeStr": "{d} days, {h} hours, {m} minutes, {s} seconds",
"botInfo": "Bot Information",
"dbSection": "Database",
"dbStatus": "Status",
"dbFileSize": "File Size",
"loadedMsgs": "Loaded Messages",
"scanTimeField": "Scan Time",
"oldestMsgField": "Oldest Message",
"serverStats": "Server Statistics",
"monitoredChannelsField": "Monitored Channels",
"totalMembersField": "Total Members",
"resourcesSection": "Resources",
"ramUsageField": "RAM Usage",
"supportDiscord": "Support Discord",
"periodicReportHourly": "Periodic Report (Hourly)",
"periodicReportDaily": "Periodic Report (Daily)",
"publishTime": "Publish Time",
"totalCurrentMessages": "Total Current Messages",
"newMessagesGenerated": "New Messages Generated",
"editedMessagesField": "Edited Messages",
"deletedMessagesField": "Deleted Messages",
"msgCountSuffix": "{count} messages",
"loadingDbFirst": "Populating message data into database for the first time... (this process may take a few seconds or minutes).",
"loadingDbSync": "Checking and synchronizing message data with the server... (this process may take a few seconds or minutes).",
"channelsProgressStr": "\rChannels: {completed}/{total} | Processed: {count} messages | Speed: {speed:.2f} messages/sec",
"scanCompleteFirstStr": "Successfully loaded {count} messages into the database in {time} seconds",
"scanCompleteSyncStr": "Successfully synchronized {count} messages in {time} seconds",
"oldestMsgStr": "Oldest message time: {date}",
"statsDescription": "Get operational statistics of MACB",
"healthDescription": "Get detailed runtime health of MACB",
"reportDescription": "Generate and send a MACB report now",
"generalSection": "General",
"activitySection": "Activity",
"startupScanSection": "Startup Scan",
"runtimeSection": "Runtime",
"healthTitle": "MACB Health",
"heartbeatsSection": "Heartbeats",
"tasksSection": "Tasks",
"queuesSection": "Queues",
"latencySection": "Latency",
"uptimeField": "Uptime",
"botField": "Bot",
"scheduleField": "Schedule",
"watchdogField": "Watchdog",
"queueField": "Queue",
"logQueueField": "Log Queue",
"newField": "New",
"editedField": "Edited",
"deletedField": "Deleted",
"progressField": "Progress",
"bootScannedField": "Boot scanned",
"retriesField": "Retries",
"droppedField": "Dropped",
"throughputField": "Throughput",
"healthyStatus": "Healthy",
"warningStatus": "Warning",
"okStatus": "OK",
"staleStatus": "STALE",
"noHeartbeatStatus": "no heartbeat",
"taskMissing": "missing",
"taskCancelled": "cancelled",
"taskStopped": "stopped",
"taskRunning": "running",
"metricsTaskField": "Metrics",
"periodicReportTaskField": "Periodic report",
"databaseWorkerField": "Database worker",
"mediaCacheTaskField": "Media cache",
"logWorkersField": "Log workers",
"sendLatencyField": "Send",
"downloadLatencyField": "Download",
"databaseShortField": "Database",
"logShortField": "Log",
"reportPermissionDenied": "You need Manage Server permission to run this command.",
"reportSent": "Report sent to <#{channelId}>.",
"reportFailed": "Report failed. Check bot logs and log channel permission.",
"statsFooter": "Bot by @meowice | Source: github.com/MeowIce/macb",
"secondsSuffix": "{value} seconds",
"heartbeatAgeSuffix": "{value:.1f}s ago",
"reportScheduleHourlyValue": "hourly",
"reportScheduleDailyValue": "daily",
"targetLogChannelIdField": "Log Channel ID",
"replayDescription": "Replay dead-letter log payloads from SQLite queue",
"replaySuccess": "Successfully replayed {count} dead letters.",
"replayEmpty": "No dead letters pending replay.",
"reportTypeManual": "Manual (Slash Command)",
"reportTypeScheduled": "Scheduled (Automated)",
"reportTypeField": "Dispatch Mode",
"botStatus": "{count:,} total messages",
"botStatusSyncing": "Synchronizing messages",
}
}
def getLocaleString(key, **kwargs):
lang = getattr(config, "botLang", "vi")
targetLang = lang if lang in stringsMap else "vi"
return stringsMap[targetLang].get(key, "").format(**kwargs)