Skip to content

Commit cb81489

Browse files
committed
Translate all status messages in the UI
1 parent f25da89 commit cb81489

2 files changed

Lines changed: 137 additions & 9 deletions

File tree

bookmark_checker/i18n/translations.py

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
"count": "Count",
1616
"ready": "Ready",
1717
"parsing_files": "Parsing files...",
18+
"loaded_bookmarks": "Loaded {count} bookmarks from {files} file(s)",
19+
"no_bookmarks_found": "No bookmarks found in files",
20+
"error_loading_files": "Error loading files",
21+
"merging": "Merging and deduplicating...",
22+
"merged_to": "Merged to {count} unique bookmarks ({groups} groups)",
23+
"error_during_merge": "Error during merge",
24+
"exporting": "Exporting...",
25+
"exported_to": "Exported to {path1} and {path2}",
26+
"error_during_export": "Error during export",
1827
"error": "Error",
1928
"success": "Success",
2029
"exported_successfully": "Exported successfully!",
@@ -33,6 +42,15 @@
3342
"count": "Количество",
3443
"ready": "Готово",
3544
"parsing_files": "Обработка файлов...",
45+
"loaded_bookmarks": "Загружено {count} закладок из {files} файла(ов)",
46+
"no_bookmarks_found": "Закладки не найдены в файлах",
47+
"error_loading_files": "Ошибка загрузки файлов",
48+
"merging": "Объединение и дедупликация...",
49+
"merged_to": "Объединено в {count} уникальных закладок ({groups} групп)",
50+
"error_during_merge": "Ошибка при объединении",
51+
"exporting": "Экспорт...",
52+
"exported_to": "Экспортировано в {path1} и {path2}",
53+
"error_during_export": "Ошибка при экспорте",
3654
"error": "Ошибка",
3755
"success": "Успешно",
3856
"exported_successfully": "Экспорт выполнен успешно!",
@@ -51,6 +69,15 @@
5169
"count": "Contagem",
5270
"ready": "Pronto",
5371
"parsing_files": "Analisando arquivos...",
72+
"loaded_bookmarks": "Carregados {count} marcadores de {files} arquivo(s)",
73+
"no_bookmarks_found": "Nenhum marcador encontrado nos arquivos",
74+
"error_loading_files": "Erro ao carregar arquivos",
75+
"merging": "Mesclando e deduplicando...",
76+
"merged_to": "Mesclado para {count} marcadores únicos ({groups} grupos)",
77+
"error_during_merge": "Erro durante a mesclagem",
78+
"exporting": "Exportando...",
79+
"exported_to": "Exportado para {path1} e {path2}",
80+
"error_during_export": "Erro durante a exportação",
5481
"error": "Erro",
5582
"success": "Sucesso",
5683
"exported_successfully": "Exportado com sucesso!",
@@ -69,6 +96,15 @@
6996
"count": "Cantidad",
7097
"ready": "Listo",
7198
"parsing_files": "Analizando archivos...",
99+
"loaded_bookmarks": "Cargados {count} marcadores de {files} archivo(s)",
100+
"no_bookmarks_found": "No se encontraron marcadores en los archivos",
101+
"error_loading_files": "Error al cargar archivos",
102+
"merging": "Fusionando y deduplicando...",
103+
"merged_to": "Fusionado a {count} marcadores únicos ({groups} grupos)",
104+
"error_during_merge": "Error durante la fusión",
105+
"exporting": "Exportando...",
106+
"exported_to": "Exportado a {path1} y {path2}",
107+
"error_during_export": "Error durante la exportación",
72108
"error": "Error",
73109
"success": "Éxito",
74110
"exported_successfully": "¡Exportado exitosamente!",
@@ -87,6 +123,15 @@
87123
"count": "Arv",
88124
"ready": "Valmis",
89125
"parsing_files": "Failide töötlemine...",
126+
"loaded_bookmarks": "Laetud {count} järjehoidjat {files} failist",
127+
"no_bookmarks_found": "Järjehoidjaid ei leitud failidest",
128+
"error_loading_files": "Viga failide laadimisel",
129+
"merging": "Ühendamine ja duplikaatide eemaldamine...",
130+
"merged_to": "Ühendatud {count} unikaalseks järjehoidjaks ({groups} gruppi)",
131+
"error_during_merge": "Viga ühendamisel",
132+
"exporting": "Eksportimine...",
133+
"exported_to": "Eksporditud {path1} ja {path2}",
134+
"error_during_export": "Viga eksportimisel",
90135
"error": "Viga",
91136
"success": "Õnnestus",
92137
"exported_successfully": "Eksport õnnestus!",
@@ -105,6 +150,15 @@
105150
"count": "Nombre",
106151
"ready": "Prêt",
107152
"parsing_files": "Analyse des fichiers...",
153+
"loaded_bookmarks": "Chargé {count} marque-pages depuis {files} fichier(s)",
154+
"no_bookmarks_found": "Aucun marque-page trouvé dans les fichiers",
155+
"error_loading_files": "Erreur lors du chargement des fichiers",
156+
"merging": "Fusion et déduplication...",
157+
"merged_to": "Fusionné en {count} marque-pages uniques ({groups} groupes)",
158+
"error_during_merge": "Erreur lors de la fusion",
159+
"exporting": "Exportation...",
160+
"exported_to": "Exporté vers {path1} et {path2}",
161+
"error_during_export": "Erreur lors de l'exportation",
108162
"error": "Erreur",
109163
"success": "Succès",
110164
"exported_successfully": "Exporté avec succès!",
@@ -123,6 +177,15 @@
123177
"count": "Anzahl",
124178
"ready": "Bereit",
125179
"parsing_files": "Dateien werden analysiert...",
180+
"loaded_bookmarks": "{count} Lesezeichen aus {files} Datei(en) geladen",
181+
"no_bookmarks_found": "Keine Lesezeichen in den Dateien gefunden",
182+
"error_loading_files": "Fehler beim Laden der Dateien",
183+
"merging": "Zusammenführen und Deduplizieren...",
184+
"merged_to": "Zusammengeführt zu {count} eindeutigen Lesezeichen ({groups} Gruppen)",
185+
"error_during_merge": "Fehler beim Zusammenführen",
186+
"exporting": "Exportieren...",
187+
"exported_to": "Exportiert nach {path1} und {path2}",
188+
"error_during_export": "Fehler beim Exportieren",
126189
"error": "Fehler",
127190
"success": "Erfolg",
128191
"exported_successfully": "Erfolgreich exportiert!",
@@ -141,6 +204,15 @@
141204
"count": "数",
142205
"ready": "準備完了",
143206
"parsing_files": "ファイルを解析中...",
207+
"loaded_bookmarks": "{files}ファイルから{count}個のブックマークを読み込みました",
208+
"no_bookmarks_found": "ファイルにブックマークが見つかりませんでした",
209+
"error_loading_files": "ファイルの読み込みエラー",
210+
"merging": "マージと重複除去中...",
211+
"merged_to": "{count}個の一意のブックマーク({groups}グループ)にマージされました",
212+
"error_during_merge": "マージ中にエラーが発生しました",
213+
"exporting": "エクスポート中...",
214+
"exported_to": "{path1}と{path2}にエクスポートされました",
215+
"error_during_export": "エクスポート中にエラーが発生しました",
144216
"error": "エラー",
145217
"success": "成功",
146218
"exported_successfully": "正常にエクスポートされました!",
@@ -159,6 +231,15 @@
159231
"count": "数量",
160232
"ready": "就绪",
161233
"parsing_files": "正在解析文件...",
234+
"loaded_bookmarks": "从{files}个文件加载了{count}个书签",
235+
"no_bookmarks_found": "文件中未找到书签",
236+
"error_loading_files": "加载文件时出错",
237+
"merging": "正在合并和去重...",
238+
"merged_to": "已合并为{count}个唯一书签({groups}组)",
239+
"error_during_merge": "合并时出错",
240+
"exporting": "正在导出...",
241+
"exported_to": "已导出到{path1}和{path2}",
242+
"error_during_export": "导出时出错",
162243
"error": "错误",
163244
"success": "成功",
164245
"exported_successfully": "导出成功!",
@@ -177,6 +258,15 @@
177258
"count": "개수",
178259
"ready": "준비됨",
179260
"parsing_files": "파일 구문 분석 중...",
261+
"loaded_bookmarks": "{files}개 파일에서 {count}개의 북마크를 로드했습니다",
262+
"no_bookmarks_found": "파일에서 북마크를 찾을 수 없습니다",
263+
"error_loading_files": "파일 로드 중 오류",
264+
"merging": "병합 및 중복 제거 중...",
265+
"merged_to": "{count}개의 고유 북마크({groups}개 그룹)로 병합되었습니다",
266+
"error_during_merge": "병합 중 오류",
267+
"exporting": "내보내는 중...",
268+
"exported_to": "{path1} 및 {path2}로 내보냈습니다",
269+
"error_during_export": "내보내는 중 오류",
180270
"error": "오류",
181271
"success": "성공",
182272
"exported_successfully": "성공적으로 내보냈습니다!",
@@ -195,6 +285,15 @@
195285
"count": "Jumlah",
196286
"ready": "Siap",
197287
"parsing_files": "Memproses file...",
288+
"loaded_bookmarks": "Memuat {count} bookmark dari {files} file",
289+
"no_bookmarks_found": "Tidak ada bookmark ditemukan di file",
290+
"error_loading_files": "Kesalahan saat memuat file",
291+
"merging": "Menggabungkan dan menghapus duplikat...",
292+
"merged_to": "Digabungkan menjadi {count} bookmark unik ({groups} grup)",
293+
"error_during_merge": "Kesalahan saat menggabungkan",
294+
"exporting": "Mengekspor...",
295+
"exported_to": "Diekspor ke {path1} dan {path2}",
296+
"error_during_export": "Kesalahan saat mengekspor",
198297
"error": "Kesalahan",
199298
"success": "Berhasil",
200299
"exported_successfully": "Berhasil diekspor!",

bookmark_checker/ui/main_window.py

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,20 @@ def _process_files(self, files: list[str]) -> None:
300300
get_translation(self.current_language, "error", "Error"),
301301
f"No bookmarks were found in the selected files.\n\nFiles: {', '.join(files)}",
302302
)
303-
self.status_label.setText("No bookmarks found in files")
303+
self.status_label.setText(
304+
get_translation(
305+
self.current_language, "no_bookmarks_found", "No bookmarks found in files"
306+
)
307+
)
304308
self.btn_merge.setEnabled(False)
305309
else:
310+
loaded_msg = get_translation(
311+
self.current_language,
312+
"loaded_bookmarks",
313+
"Loaded {count} bookmarks from {files} file(s)",
314+
)
306315
self.status_label.setText(
307-
f"Loaded {len(collection.bookmarks)} " f"bookmarks from {len(files)} file(s)"
316+
loaded_msg.format(count=len(collection.bookmarks), files=len(files))
308317
)
309318
self.btn_merge.setEnabled(True)
310319
# Show bookmarks in table immediately
@@ -316,7 +325,9 @@ def _process_files(self, files: list[str]) -> None:
316325
QMessageBox.critical(
317326
self, get_translation(self.current_language, "error", "Error"), error_msg
318327
)
319-
self.status_label.setText("Error loading files")
328+
self.status_label.setText(
329+
get_translation(self.current_language, "error_loading_files", "Error loading files")
330+
)
320331
self.btn_merge.setEnabled(False)
321332
finally:
322333
self.progress_bar.setVisible(False)
@@ -326,7 +337,9 @@ def _find_and_merge(self) -> None:
326337
if not self.current_collection:
327338
return
328339

329-
self.status_label.setText("Merging and deduplicating...")
340+
self.status_label.setText(
341+
get_translation(self.current_language, "merging", "Merging and deduplicating...")
342+
)
330343
self.progress_bar.setVisible(True)
331344
self.progress_bar.setRange(0, 0)
332345

@@ -339,8 +352,13 @@ def _find_and_merge(self) -> None:
339352
self.current_report = report
340353
self._populate_table(report)
341354

355+
merged_msg = get_translation(
356+
self.current_language,
357+
"merged_to",
358+
"Merged to {count} unique bookmarks ({groups} groups)",
359+
)
342360
self.status_label.setText(
343-
f"Merged to {len(merged.bookmarks)} unique bookmarks ({len(report)} groups)"
361+
merged_msg.format(count=len(merged.bookmarks), groups=len(report))
344362
)
345363
self.btn_export.setEnabled(True)
346364
except Exception as e:
@@ -349,7 +367,9 @@ def _find_and_merge(self) -> None:
349367
get_translation(self.current_language, "error", "Error"),
350368
f"Failed to merge:\n{e}",
351369
)
352-
self.status_label.setText("Error during merge")
370+
self.status_label.setText(
371+
get_translation(self.current_language, "error_during_merge", "Error during merge")
372+
)
353373
finally:
354374
self.progress_bar.setVisible(False)
355375

@@ -399,7 +419,9 @@ def _export_merged(self) -> None:
399419
if not output_path:
400420
return
401421

402-
self.status_label.setText("Exporting...")
422+
self.status_label.setText(
423+
get_translation(self.current_language, "exporting", "Exporting...")
424+
)
403425
self.progress_bar.setVisible(True)
404426
self.progress_bar.setRange(0, 0)
405427

@@ -421,7 +443,12 @@ def _export_merged(self) -> None:
421443
)
422444
export_dedupe_report_csv(self.current_report, str(csv_path))
423445

424-
self.status_label.setText(f"Exported to {output_path} and {csv_path}")
446+
exported_to_msg = get_translation(
447+
self.current_language,
448+
"exported_to",
449+
"Exported to {path1} and {path2}",
450+
)
451+
self.status_label.setText(exported_to_msg.format(path1=output_path, path2=csv_path))
425452
exported_msg = get_translation(
426453
self.current_language, "exported_successfully", "Exported successfully!"
427454
)
@@ -436,7 +463,9 @@ def _export_merged(self) -> None:
436463
get_translation(self.current_language, "error", "Error"),
437464
f"Failed to export:\n{e}",
438465
)
439-
self.status_label.setText("Error during export")
466+
self.status_label.setText(
467+
get_translation(self.current_language, "error_during_export", "Error during export")
468+
)
440469
finally:
441470
self.progress_bar.setVisible(False)
442471

0 commit comments

Comments
 (0)