Skip to content

Commit c54dc7c

Browse files
committed
Update translations for workspace status label and clear workspace button
1 parent 358c382 commit c54dc7c

14 files changed

Lines changed: 130 additions & 35 deletions

File tree

Core/WorkSpaceManager/SetupWorkspace.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,18 @@ def apply_workspace_selection(
170170
)
171171
if hasattr(gui_instance, "label_workspace_status"):
172172
try:
173-
gui_instance.label_workspace_status.setText(
174-
gui_instance.tr(
175-
f"Workspace : {folder}", f"Workspace: {folder}"
173+
tr_map = getattr(gui_instance, "_tr", None)
174+
if isinstance(tr_map, dict):
175+
tmpl = tr_map.get("label_workspace_status") or "Workspace: {path}"
176+
gui_instance.label_workspace_status.setText(
177+
str(tmpl).replace("{path}", str(folder))
178+
)
179+
else:
180+
gui_instance.label_workspace_status.setText(
181+
gui_instance.tr(
182+
f"Workspace : {folder}", f"Workspace: {folder}"
183+
)
176184
)
177-
)
178185
except Exception:
179186
pass
180187

Core/WorkSpaceManager/WorkspaceAdvancedManipulation.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,17 +266,28 @@ def clear_workspace(gui_instance, keep_dir: bool = True) -> bool:
266266
)
267267
if hasattr(gui_instance, "label_workspace_status"):
268268
try:
269-
if keep_dir and workspace_dir:
270-
gui_instance.label_workspace_status.setText(
271-
gui_instance.tr(
272-
f"Workspace : {workspace_dir}",
273-
f"Workspace: {workspace_dir}",
269+
tr_map = getattr(gui_instance, "_tr", None)
270+
if isinstance(tr_map, dict):
271+
if keep_dir and workspace_dir:
272+
tmpl = tr_map.get("label_workspace_status") or "Workspace: {path}"
273+
gui_instance.label_workspace_status.setText(
274+
str(tmpl).replace("{path}", str(workspace_dir))
274275
)
275-
)
276+
else:
277+
val = tr_map.get("label_workspace_status_none") or "Workspace: None"
278+
gui_instance.label_workspace_status.setText(str(val))
276279
else:
277-
gui_instance.label_workspace_status.setText(
278-
gui_instance.tr("Workspace : Aucun", "Workspace: None")
279-
)
280+
if keep_dir and workspace_dir:
281+
gui_instance.label_workspace_status.setText(
282+
gui_instance.tr(
283+
f"Workspace : {workspace_dir}",
284+
f"Workspace: {workspace_dir}",
285+
)
286+
)
287+
else:
288+
gui_instance.label_workspace_status.setText(
289+
gui_instance.tr("Workspace : Aucun", "Workspace: None")
290+
)
280291
except Exception:
281292
pass
282293

Core/i18n.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
"label_files_section": "2. Files to build",
4646
"btn_remove_file": "🗑️ Remove selected file",
4747
"label_logs_section": "Build logs",
48+
"label_workspace_status": "Workspace: {path}",
49+
"label_workspace_status_none": "Workspace: None",
50+
"file_filter_placeholder": "Filter list…",
51+
"btn_clear_workspace": "🧹 Clear workspace",
4852
"choose_language_title": "Choose language",
4953
"choose_language_label": "Language:",
5054
"choose_language_system": "System",
@@ -65,6 +69,7 @@
6569
"tt_venv_button": "Manually select a venv directory to use for compilation.",
6670
"tt_suggest_deps": "Analyze the project for missing Python dependencies.",
6771
"tt_show_stats": "Show build statistics (time, number of files, memory).",
72+
"tt_clear_workspace": "Clear the file list and reset the selection.",
6873
}
6974

7075

@@ -373,6 +378,7 @@ def _tt(key: str, current: str) -> str:
373378
_set("btn_help", "help")
374379
_set("btn_show_stats", "show_stats")
375380
_set("btn_remove_file", "btn_remove_file")
381+
_set("btn_clear_workspace", "btn_clear_workspace")
376382

377383
# Bouton de langue (variante System vs simple), sans valeur de secours
378384
try:
@@ -417,6 +423,21 @@ def _tt(key: str, current: str) -> str:
417423
_set("label_files_section", "label_files_section")
418424
_set("label_logs_section", "label_logs_section")
419425

426+
# Workspace status label (dynamic path if available)
427+
if getattr(self, "label_workspace_status", None):
428+
try:
429+
ws = getattr(self, "workspace_dir", None)
430+
if ws:
431+
tmpl = tr.get("label_workspace_status") or "Workspace: {path}"
432+
self.label_workspace_status.setText(
433+
str(tmpl).replace("{path}", str(ws))
434+
)
435+
else:
436+
val = tr.get("label_workspace_status_none") or "Workspace: None"
437+
self.label_workspace_status.setText(str(val))
438+
except Exception:
439+
pass
440+
420441
# === TABS ===
421442
if getattr(self, "compiler_tabs", None):
422443
try:
@@ -483,6 +504,13 @@ def _tt(key: str, current: str) -> str:
483504
self.nuitka_output_dir.setPlaceholderText(ph)
484505
except Exception:
485506
pass
507+
if getattr(self, "file_filter_input", None):
508+
try:
509+
ph = tr.get("file_filter_placeholder")
510+
if isinstance(ph, str) and ph.strip():
511+
self.file_filter_input.setPlaceholderText(ph)
512+
except Exception:
513+
pass
486514

487515
# === TOOLTIPS ===
488516
# Main buttons tooltips
@@ -536,6 +564,10 @@ def _tt(key: str, current: str) -> str:
536564
self.btn_show_stats.setToolTip(
537565
_tt("tt_show_stats", self.btn_show_stats.toolTip())
538566
)
567+
if getattr(self, "btn_clear_workspace", None):
568+
self.btn_clear_workspace.setToolTip(
569+
_tt("tt_clear_workspace", self.btn_clear_workspace.toolTip())
570+
)
539571

540572
# Output directory tooltip
541573
if getattr(self, "output_dir_input", None):

languages/af.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"label_files_section": "2. Lêers om te bou",
2525
"btn_remove_file": "🗑️ Verwyder gekose lêer",
2626
"label_logs_section": "Boulog",
27-
2827
"choose_language_title": "Kies taal",
2928
"choose_language_label": "Taal:",
3029
"choose_language_system": "Stelsel",
@@ -44,5 +43,10 @@
4443
"tt_bc_loader": "Stel Plugins (BCASL) inproppe op om voor kompilasie te loop.",
4544
"tt_venv_button": "Kies handmatig 'n venv-lêergids om vir kompilasie te gebruik.",
4645
"tt_suggest_deps": "Ontleed die projek vir ontbrekende Python-afhanklikhede.",
47-
"tt_show_stats": "Wys boustatistieke (tyd, aantal lêers, geheue)."
46+
"tt_show_stats": "Wys boustatistieke (tyd, aantal lêers, geheue).",
47+
"label_workspace_status": "Werkruimte: {path}",
48+
"label_workspace_status_none": "Werkruimte: Geen",
49+
"file_filter_placeholder": "Filter lys…",
50+
"btn_clear_workspace": "🧹 Maak werkruimte skoon",
51+
"tt_clear_workspace": "Maak die lêerlys skoon en herstel die keuse."
4852
}

languages/de.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"label_files_section": "2. Zu erstellende Dateien",
2525
"btn_remove_file": "🗑️ Ausgewählte Datei entfernen",
2626
"label_logs_section": "Build-Protokolle",
27-
2827
"choose_language_title": "Sprache wählen",
2928
"choose_language_label": "Sprache:",
3029
"choose_language_system": "System",
@@ -44,5 +43,10 @@
4443
"tt_bc_loader": "Plugins-(BCASL)-Plugins konfigurieren, die vor der Kompilierung ausgeführt werden.",
4544
"tt_venv_button": "Venv-Verzeichnis manuell für die Kompilierung auswählen.",
4645
"tt_suggest_deps": "Projekt auf fehlende Python-Abhängigkeiten analysieren.",
47-
"tt_show_stats": "Build-Statistiken anzeigen (Zeit, Anzahl der Dateien, Speicher)."
46+
"tt_show_stats": "Build-Statistiken anzeigen (Zeit, Anzahl der Dateien, Speicher).",
47+
"label_workspace_status": "Arbeitsbereich: {path}",
48+
"label_workspace_status_none": "Arbeitsbereich: Kein",
49+
"file_filter_placeholder": "Liste filtern…",
50+
"btn_clear_workspace": "🧹 Workspace leeren",
51+
"tt_clear_workspace": "Dateiliste leeren und Auswahl zurücksetzen."
4852
}

languages/en.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"label_files_section": "2. Files to build",
2525
"btn_remove_file": "🗑️ Remove selected file",
2626
"label_logs_section": "Build logs",
27-
2827
"choose_language_title": "Choose language",
2928
"choose_language_label": "Language:",
3029
"choose_language_system": "System",
@@ -33,7 +32,6 @@
3332
"select_theme": "Choose theme",
3433
"choose_theme_button": "Choose theme",
3534
"choose_theme_system_button": "Choose theme (System)",
36-
3735
"tt_select_folder": "Select the workspace directory containing your Python files.",
3836
"tt_select_files": "Add Python files manually to the build list.",
3937
"tt_build_all": "Start building all selected files.",
@@ -45,6 +43,10 @@
4543
"tt_bc_loader": "Configure Plugins (BCASL) plugins to run before compilation.",
4644
"tt_venv_button": "Manually select a venv directory to use for compilation.",
4745
"tt_suggest_deps": "Analyze the project for missing Python dependencies.",
48-
"tt_show_stats": "Show build statistics (time, number of files, memory)."
46+
"tt_show_stats": "Show build statistics (time, number of files, memory).",
47+
"label_workspace_status": "Workspace: {path}",
48+
"label_workspace_status_none": "Workspace: None",
49+
"file_filter_placeholder": "Filter list…",
50+
"btn_clear_workspace": "🧹 Clear workspace",
51+
"tt_clear_workspace": "Clear the file list and reset the selection."
4952
}
50-

languages/es.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"label_files_section": "2. Archivos a compilar",
2525
"btn_remove_file": "🗑️ Eliminar archivo seleccionado",
2626
"label_logs_section": "Registros de compilación",
27-
2827
"choose_language_title": "Elegir idioma",
2928
"choose_language_label": "Idioma:",
3029
"choose_language_system": "Sistema",
@@ -44,5 +43,10 @@
4443
"tt_bc_loader": "Configurar plugins de Plugins (BCASL) para ejecutar antes de la compilación.",
4544
"tt_venv_button": "Seleccionar manualmente un directorio venv para usar en la compilación.",
4645
"tt_suggest_deps": "Analizar el proyecto en busca de dependencias de Python faltantes.",
47-
"tt_show_stats": "Mostrar estadísticas de compilación (tiempo, número de archivos, memoria)."
46+
"tt_show_stats": "Mostrar estadísticas de compilación (tiempo, número de archivos, memoria).",
47+
"label_workspace_status": "Espacio de trabajo: {path}",
48+
"label_workspace_status_none": "Espacio de trabajo: Ninguno",
49+
"file_filter_placeholder": "Filtrar lista…",
50+
"btn_clear_workspace": "🧹 Limpiar workspace",
51+
"tt_clear_workspace": "Vaciar la lista de archivos y reiniciar la selección."
4852
}

languages/fr.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"label_files_section": "2. Fichiers à compiler",
2525
"btn_remove_file": "🗑️ Supprimer le fichier sélectionné",
2626
"label_logs_section": "Logs de compilation",
27-
2827
"choose_language_title": "Choisir la langue",
2928
"choose_language_label": "Langue :",
3029
"choose_language_system": "Système",
@@ -44,5 +43,10 @@
4443
"tt_bc_loader": "Configurer les plugins Plugins (BCASL) à exécuter avant la compilation.",
4544
"tt_venv_button": "Sélectionner manuellement un dossier venv à utiliser pour la compilation.",
4645
"tt_suggest_deps": "Analyser le projet pour détecter les dépendances Python manquantes.",
47-
"tt_show_stats": "Afficher les statistiques de compilation (temps, nombre de fichiers, mémoire)."
48-
}
46+
"tt_show_stats": "Afficher les statistiques de compilation (temps, nombre de fichiers, mémoire).",
47+
"label_workspace_status": "Espace de travail : {path}",
48+
"label_workspace_status_none": "Espace de travail : Aucun",
49+
"file_filter_placeholder": "Filtrer la liste…",
50+
"btn_clear_workspace": "🧹 Vider le workspace",
51+
"tt_clear_workspace": "Vider la liste des fichiers et réinitialiser la sélection."
52+
}

languages/it.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"label_files_section": "2. File da compilare",
2525
"btn_remove_file": "🗑️ Rimuovi file selezionato",
2626
"label_logs_section": "Log di compilazione",
27-
2827
"choose_language_title": "Scegli lingua",
2928
"choose_language_label": "Lingua:",
3029
"choose_language_system": "Sistema",
@@ -44,5 +43,10 @@
4443
"tt_bc_loader": "Configurare i plugin Plugins (BCASL) da eseguire prima della compilazione.",
4544
"tt_venv_button": "Selezionare manualmente una cartella venv da usare per la compilazione.",
4645
"tt_suggest_deps": "Analizzare il progetto per le dipendenze Python mancanti.",
47-
"tt_show_stats": "Mostrare le statistiche di compilazione (tempo, numero di file, memoria)."
46+
"tt_show_stats": "Mostrare le statistiche di compilazione (tempo, numero di file, memoria).",
47+
"label_workspace_status": "Spazio di lavoro: {path}",
48+
"label_workspace_status_none": "Spazio di lavoro: Nessuno",
49+
"file_filter_placeholder": "Filtra elenco…",
50+
"btn_clear_workspace": "🧹 Pulisci workspace",
51+
"tt_clear_workspace": "Svuota l’elenco dei file e reimposta la selezione."
4852
}

languages/ja.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"label_files_section": "2. ビルドするファイル",
2525
"btn_remove_file": "🗑️ 選択したファイルを削除",
2626
"label_logs_section": "ビルドログ",
27-
2827
"choose_language_title": "言語を選択",
2928
"choose_language_label": "言語:",
3029
"choose_language_system": "システム",
@@ -44,6 +43,10 @@
4443
"tt_bc_loader": "コンパイル前に実行する Plugins(BCASL)プラグインを設定します。",
4544
"tt_venv_button": "コンパイルに使用する venv ディレクトリを手動で選択します。",
4645
"tt_suggest_deps": "プロジェクトを解析して不足している Python 依存関係を検出します。",
47-
"tt_show_stats": "ビルドの統計情報(時間、ファイル数、メモリ)を表示します。"
46+
"tt_show_stats": "ビルドの統計情報(時間、ファイル数、メモリ)を表示します。",
47+
"label_workspace_status": "ワークスペース: {path}",
48+
"label_workspace_status_none": "ワークスペース: なし",
49+
"file_filter_placeholder": "リストを絞り込み…",
50+
"btn_clear_workspace": "🧹 ワークスペースをクリア",
51+
"tt_clear_workspace": "ファイル一覧をクリアして選択をリセットします。"
4852
}
49-

0 commit comments

Comments
 (0)