Skip to content

Commit 9280409

Browse files
feat: 添加将语言文件导出为json和导入从crowdin下载的语言bundle的功能
1 parent 072cc8b commit 9280409

22 files changed

Lines changed: 2115 additions & 32 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,6 @@ cython_debug/
185185
/app/config
186186
/app/config
187187
/app/config
188+
189+
# Scripts' generations
190+
/scripts/*.json

app/Language/modules/basic_settings.py

Lines changed: 240 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,244 @@
136136
"name": "即将导出诊断数据,包括:\n\n软件信息、设置配置\n点名名单、抽奖名单\n历史记录、日志文件\n\n注意: 导出的数据可能包含敏感信息,请妥善保管。\n\n是否继续导出?"
137137
},
138138
},
139-
}
139+
},
140+
"EN_US": {
141+
"title": {
142+
"name": "Basic settings",
143+
"description": "Configure basic features and appearance of software",
144+
},
145+
"basic_function": {
146+
"name": "Basic functions",
147+
"description": "Configure software's core functions",
148+
},
149+
"data_management": {
150+
"name": "Data management",
151+
"description": "Import or export the software's data",
152+
},
153+
"personalised": {
154+
"name": "Customization",
155+
"description": "Customize the look and experience of software",
156+
},
157+
"autostart": {
158+
"name": "Start on boot",
159+
"description": "Set whether the software is running automatically with the system",
160+
},
161+
"check_update": {
162+
"name": "Check for updates on startup",
163+
"description": "Set whether new versions will be checked automatically on boot",
164+
},
165+
"show_startup_window": {
166+
"name": "Show splash screen",
167+
"description": "Set whether to show the splash screen on boot",
168+
},
169+
"export_diagnostic_data": {
170+
"name": "Export diagnostic data",
171+
"description": "Export Diagnostic Information on Exit",
172+
"pushbutton_name": "Export diagnostic data",
173+
},
174+
"export_settings": {
175+
"name": "Export settings",
176+
"description": "Export current settings to profile",
177+
"pushbutton_name": "Export settings",
178+
},
179+
"import_settings": {
180+
"name": "Import settings",
181+
"description": "Import settings from profile to overwrite the current profile",
182+
"pushbutton_name": "Import settings",
183+
},
184+
"export_all_data": {
185+
"name": "Export all data",
186+
"description": "Export all data and settings on exit",
187+
"pushbutton_name": "Export all data",
188+
},
189+
"import_all_data": {
190+
"name": "Import all data",
191+
"description": "Restore all data from backup file on boot",
192+
"pushbutton_name": "Import all data",
193+
},
194+
"dpiScale": {
195+
"name": "DPI Scale",
196+
"description": "Resize the app interface (restart required)",
197+
"combo_items": {
198+
"0": "100%",
199+
"1": "125%",
200+
"2": "150%",
201+
"3": "175%",
202+
"4": "200%",
203+
"5": "Auto",
204+
},
205+
},
206+
"font": {
207+
"name": "Font",
208+
"description": "Set the font to display (restart required)",
209+
},
210+
"theme": {
211+
"name": "Theme mode",
212+
"description": "Select the theme for the software interface",
213+
"combo_items": {
214+
"0": "Light",
215+
"1": "Dark",
216+
"2": "Follow system",
217+
},
218+
},
219+
"theme_color": {
220+
"name": "Theme color",
221+
"description": "Set the theme color of the software",
222+
},
223+
"language": {
224+
"name": "Display language",
225+
"description": "Switch the software interface language (restart required)",
226+
},
227+
"background_resident": {
228+
"name": "Parish in backend",
229+
"description": "Whether to remain in the back office after closing all windows",
230+
},
231+
"url_protocol": {
232+
"name": "URL Protocol Registration",
233+
"description": "Sign up for custom URL protocol (secrandom://), support to launch app via link",
234+
},
235+
"log_level": {
236+
"name": "Log level",
237+
"description": "Set the level of detail for log entries",
238+
"combo_items": {
239+
"0": "DEBUG",
240+
"1": "INFO",
241+
"2": "WARNING",
242+
"3": "ERROR",
243+
"4": "CRITICAL",
244+
},
245+
},
246+
"settings_import_export": {
247+
"export_success_title": {
248+
"name": "Export settings",
249+
},
250+
"export_success_content": {
251+
"name": "设置已成功导出到:\n{path}",
252+
},
253+
"export_failure_title": {
254+
"name": "Export settings",
255+
},
256+
"export_failure_content": {
257+
"name": "导出设置失败:\n{error}",
258+
},
259+
"import_confirm_title": {
260+
"name": "Import settings",
261+
},
262+
"import_confirm_content": {
263+
"name": "Are you sure you want to import these settings? This will overwrite the current settings",
264+
},
265+
"import_confirm_button": {
266+
"name": "Confirm import",
267+
},
268+
"import_cancel_button": {
269+
"name": "Cancel import",
270+
},
271+
"import_success_title": {
272+
"name": "Import settings",
273+
},
274+
"import_success_content": {
275+
"name": "Settings successfully imported\napplication restarted for changes to take effect",
276+
},
277+
"import_success_button": {
278+
"name": "I know",
279+
},
280+
"export_success_button": {
281+
"name": "I know",
282+
},
283+
"import_failure_title": {
284+
"name": "Import settings",
285+
},
286+
"import_failure_content": {
287+
"name": "导入设置失败:\n{error}",
288+
},
289+
},
290+
"data_import_export": {
291+
"export_success_title": {
292+
"name": "Export all data",
293+
},
294+
"export_success_content": {
295+
"name": "所有数据已成功导出到:\n{path}",
296+
},
297+
"export_failure_title": {
298+
"name": "Export all data",
299+
},
300+
"export_failure_content": {
301+
"name": "导出所有数据失败:\n{error}",
302+
},
303+
"import_confirm_title": {
304+
"name": "Import all data",
305+
},
306+
"import_confirm_content": {
307+
"name": "Are you sure you want to import these data? This will overwrite the current data",
308+
},
309+
"import_confirm_button": {
310+
"name": "Confirm import",
311+
},
312+
"import_cancel_button": {
313+
"name": "Cancel import",
314+
},
315+
"import_success_title": {
316+
"name": "Import all data",
317+
},
318+
"import_success_content": {
319+
"name": "Data imported successfully into\napplication restarted for changes to take effect",
320+
},
321+
"import_success_button": {
322+
"name": "I know",
323+
},
324+
"import_failure_title": {
325+
"name": "Import all data",
326+
},
327+
"import_failure_content": {
328+
"name": "导入所有数据失败:\n{error}",
329+
},
330+
"existing_files_count": {
331+
"name": "\n... 还有 {len} 个文件",
332+
},
333+
"existing_files_title": {
334+
"name": "File already exists",
335+
},
336+
"existing_files_content": {
337+
"name": "以下文件已存在:\n{files}\n\n是否覆盖这些文件?",
338+
},
339+
"version_mismatch_title": {
340+
"name": "Version mismatch",
341+
},
342+
"version_mismatch_content": {
343+
"name": "导出数据的软件版本与当前版本不一致:\n\n导出数据的软件: {software_name} {version}\n当前软件: SecRandom {current_version}\n\n是否继续导入?",
344+
},
345+
"export_warning_title": {
346+
"name": "Export all data",
347+
},
348+
"export_warning_content": {
349+
"name": "即将导出所有数据,包括:\n\n软件版本、设置配置\n点名名单、抽奖名单\n历史记录、日志文件\n\n注意: 导出的数据可能包含敏感信息,请妥善保管。\n\n是否继续导出?",
350+
},
351+
},
352+
"diagnostic_data_export": {
353+
"export_confirm_button": {
354+
"name": "Confirm Export",
355+
},
356+
"export_cancel_button": {
357+
"name": "Cancel Export",
358+
},
359+
"export_success_title": {
360+
"name": "Export diagnostic data",
361+
},
362+
"export_success_content": {
363+
"name": "诊断数据已成功导出到:\n{path}",
364+
},
365+
"export_failure_title": {
366+
"name": "Export diagnostic data",
367+
},
368+
"export_failure_content": {
369+
"name": "导出诊断数据失败:\n{error}",
370+
},
371+
"export_warning_title": {
372+
"name": "Export diagnostic data",
373+
},
374+
"export_warning_content": {
375+
"name": "即将导出诊断数据,包括:\n\n软件信息、设置配置\n点名名单、抽奖名单\n历史记录、日志文件\n\n注意: 导出的数据可能包含敏感信息,请妥善保管。\n\n是否继续导出?",
376+
},
377+
},
378+
},
140379
}

app/Language/modules/custom_settings.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# 个性设置页面的语言文件
22

33
custom_settings = {
4-
"ZH_CN": {"title": {"name": "个性设置", "description": "个性化设置选项"}}
4+
"ZH_CN": {"title": {"name": "个性设置", "description": "个性化设置选项"}},
5+
"EN_US": {
6+
"title": {
7+
"name": "Profile settings",
8+
"description": "Profile settings",
9+
},
10+
},
511
}
612

713
# 页面管理语言配置

app/Language/modules/extraction_settings.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,13 @@
275275

276276
# 自定义抽设置
277277
custom_draw_settings = {
278-
"ZH_CN": {"title": {"name": "自定义抽设置", "description": "自定义抽取功能设置"}}
278+
"ZH_CN": {"title": {"name": "自定义抽设置", "description": "自定义抽取功能设置"}},
279+
"EN_US": {
280+
"title": {
281+
"name": "Custom pick settings",
282+
"description": "Custom pick settings",
283+
},
284+
},
279285
}
280286

281287
# 抽奖设置

0 commit comments

Comments
 (0)