Skip to content

Commit 79365e1

Browse files
committed
Veuillez saisir le message de validation pour vos modifications. Les lignes
commençant par '' seront ignorées, et un message vide abandonne la validation. Sur la branche dev Votre branche est à jour avec 'origin/dev'. Modifications qui seront validées : modifié : pyproject.toml modifié : src/lufus/drives/formatting.py modifié : src/lufus/gui/gui.py modifié : src/lufus/gui/i18n.py modifié : src/lufus/gui/languages/Deutsch.csv modifié : src/lufus/gui/languages/English.csv modifié : "src/lufus/gui/languages/Espa\303\261ol.csv" modifié : "src/lufus/gui/languages/Fran\303\247ais.csv" modifié : "src/lufus/gui/languages/Portugue\314\202s Brasileiro.csv" modifié : src/lufus/gui/languages/Svenska.csv modifié : "src/lufus/gui/languages/\320\240\321\203\321\201\321\201\320\272\320\270\320\271.csv" modifié : "src/lufus/gui/languages/\321\203\320\272\321\200\320\260\321\227\320\275\321\201\321\214\320\272\320\260.csv" modifié : "src/lufus/gui/languages/\330\271\330\261\330\250\331\212.csv" modifié : "src/lufus/gui/languages/\340\246\254\340\246\276\340\246\202\340\246\262\340\246\276.csv" modifié : src/lufus/gui/workers.py modifié : src/lufus/utils.py
1 parent b070e41 commit 79365e1

16 files changed

Lines changed: 256 additions & 215 deletions

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ requires = [
5050
"psutil>=7.2",
5151
"pyqt6>=6.8.0",
5252
"pyudev>=0.24.4",
53-
"requests",
5453
"packaging",
5554
"platformdirs>=4.2"
5655
]

src/lufus/drives/formatting.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,18 @@ def unmount(drive: str = None) -> bool:
8282

8383
# mountain
8484
def remount(drive: str = None) -> bool:
85+
mount = None
8586
if not drive:
8687
mount, drive, _ = _get_mount_and_drive()
88+
else:
89+
# drive was supplied by caller; resolve mount point from current state
90+
_, _, mount_dict = _get_mount_and_drive()
91+
# find the mount point whose device node matches the given drive
92+
mount = next((mp for mp, _label in mount_dict.items()), None)
8793
if not drive:
8894
log.error("No drive node found. Cannot unmount.")
8995
return False
90-
if not drive or not mount:
96+
if not mount:
9197
log.error("No drive node or mount point found. Cannot remount.")
9298
return False
9399
log.info("Remounting %s -> %s...", drive, mount)

src/lufus/gui/gui.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import platform
77
import getpass
88
import time
9-
import requests
9+
import ssl
1010
import urllib.parse
1111
import urllib.request
1212
import webbrowser
@@ -662,6 +662,8 @@ def init_ui(self):
662662
# sha256 verification checkbox and input :D
663663
self.chk_verify = QCheckBox(self._T.get("chk_verify_hash", "Verify SHA256 Checksum"))
664664
self.chk_verify.stateChanged.connect(self.update_verify_hash)
665+
self.lbl_expected_hash = QLabel(self._T.get("lbl_expected_hash", "Expected SHA256:"))
666+
self.lbl_expected_hash.setVisible(False)
665667
self.input_hash = QLineEdit()
666668
self.input_hash.setPlaceholderText(self._T.get("input_hash_placeholder", "Enter expected SHA256 hash here..."))
667669
self.input_hash.setEnabled(False)
@@ -677,6 +679,7 @@ def init_ui(self):
677679
chk_layout.addWidget(self.chk_badblocks)
678680
chk_layout.addWidget(self.combo_badblocks)
679681
chk_layout.addWidget(self.chk_verify)
682+
chk_layout.addWidget(self.lbl_expected_hash)
680683
chk_layout.addWidget(self.input_hash)
681684

682685
main_layout.addLayout(chk_layout)
@@ -978,6 +981,8 @@ def update_verify_hash(self):
978981
# update sha256 verification setting :D
979982
state.verify_hash = self.chk_verify.isChecked()
980983
self.input_hash.setEnabled(state.verify_hash)
984+
if hasattr(self, "lbl_expected_hash"):
985+
self.lbl_expected_hash.setVisible(state.verify_hash)
981986
self._animate_widget(self.input_hash, state.verify_hash, "_anim_hash")
982987
self.log_message(f"SHA256 verification: {'enabled' if state.verify_hash else 'disabled'}")
983988

@@ -1098,7 +1103,10 @@ def _detect_iso_and_update_ui(self, iso_path: str):
10981103
"""Automatically detect ISO type and update UI selectors."""
10991104
from lufus.writing.windows.detect import detect_iso_type, IsoType
11001105

1106+
# Non-ISO raw images (.img, .bin, .raw, .dmg) are always "Other / DD mode"
11011107
if not iso_path.lower().endswith(".iso"):
1108+
self.log_message(f"Non-ISO image ({Path(iso_path).suffix or 'no ext'}), defaulting to Other/DD mode")
1109+
self.combo_image_option.setCurrentIndex(2) # Other
11021110
return
11031111

11041112
self.log_message(f"Detecting ISO type for: {iso_path}...")
@@ -1230,6 +1238,13 @@ def _update_ui_text(self):
12301238
self.btn_cancel.setText(self._T.get("btn_cancel", "Cancel"))
12311239
self.statusBar.showMessage(self._T.get("status_ready", "Ready"), 0)
12321240

1241+
# update toolbar button tooltips :3
1242+
self.btn_refresh.setToolTip(self._T.get("tooltip_refresh", "Refresh USB devices (Ctrl+R)"))
1243+
self.btn_icon1.setToolTip(self._T.get("tooltip_website", "Website"))
1244+
self.btn_icon2.setToolTip(self._T.get("tooltip_about", "About"))
1245+
self.btn_icon3.setToolTip(self._T.get("tooltip_settings", "Settings"))
1246+
self.btn_icon4.setToolTip(self._T.get("tooltip_log", "Log"))
1247+
12331248
# update image option combo :D
12341249
current_img_idx = self.combo_image_option.currentIndex()
12351250
self.combo_image_option.blockSignals(True)
@@ -1263,6 +1278,7 @@ def _update_ui_text(self):
12631278

12641279
# update verification controls :D
12651280
self.chk_verify.setText(self._T.get("chk_verify_hash", "Verify SHA256 Checksum"))
1281+
self.lbl_expected_hash.setText(self._T.get("lbl_expected_hash", "Expected SHA256:"))
12661282
self.input_hash.setPlaceholderText(self._T.get("input_hash_placeholder", "Enter expected SHA256 hash here..."))
12671283
self.input_label.setPlaceholderText(self._T.get("lbl_volume_label", "Volume Label"))
12681284

@@ -1336,6 +1352,7 @@ def cancel_process(self):
13361352
self.log_message(f"Failed to reset terminal: {e}")
13371353

13381354
# reset ui state :D
1355+
self.progress_bar.setRange(0, 100) # exit indeterminate mode
13391356
self.progress_bar.setValue(0)
13401357
self.progress_bar.setFormat("")
13411358
self.btn_start.setEnabled(True)
@@ -1672,7 +1689,8 @@ def get_latest_release(self):
16721689
url = f"https://api.github.com/repos/{owner}/{repo}/releases/latest"
16731690
current_version = state.version
16741691
try:
1675-
req = urllib.request.urlopen(url, timeout=5)
1692+
ssl_ctx = ssl.create_default_context()
1693+
req = urllib.request.urlopen(url, timeout=5, context=ssl_ctx)
16761694
if req.status == 200:
16771695
data = json.loads(req.read().decode())
16781696
tag_name = data.get("tag_name", "")

src/lufus/gui/i18n.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ def load_translations(language="English"):
1111
return t
1212
lang_file = lang_dir / f"{language}.csv"
1313
if lang_file.exists():
14-
# read translations from csv :3
15-
with open(lang_file, encoding="utf-8", newline="") as f:
14+
# utf-8-sig strips BOM that some editors insert before the first byte.
15+
# Graceful row handling: skip malformed rows (no key column, empty key).
16+
with open(lang_file, encoding="utf-8-sig", newline="") as f:
1617
for row in csv.DictReader(f):
17-
t[row["key"]] = row["value"]
18+
key = row.get("key", "").strip()
19+
value = row.get("value", "")
20+
if key:
21+
t[key] = value
1822
return t

src/lufus/gui/languages/Deutsch.csv

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ lbl_partition_scheme,Partitionsschema
2020
lbl_target_system,Zielsystem
2121
lbl_volume_label,Laufwerksbezeichnung
2222
lbl_file_system,Dateisystem
23-
lbl_flash_option,Flash-Option
23+
lbl_flash_option,Schreibmethode
2424
lbl_cluster_size,Größe der Zuordnungseinheiten
2525
combo_image_windows,Standard-Windows-Installation
2626
combo_image_linux,Standard-Linux-Installation
@@ -59,7 +59,7 @@ tooltip_log,Protokoll
5959
status_ready,Bereit
6060
status_scanning,Suche nach USB-Geräten...
6161
status_scan_failed,Suche fehlgeschlagen
62-
status_flashing,Flashing...
62+
status_flashing,Wird geschrieben...
6363
progress_preparing,Vorbereitung...
6464
progress_complete,Abgeschlossen! 100%
6565
progress_failed,Fehlgeschlagen
@@ -69,11 +69,11 @@ progress_formatted,Laufwerk formatiert.. 60%
6969
progress_label_changed,Bezeichnung geändert.. 80%
7070
progress_mount_done,Einhängen fertig.. Abgeschlossen! 100%
7171
msgbox_cancel_title,Abbrechen
72-
msgbox_cancel_body,Sind Sie sicher, dass Sie abbrechen möchten?
72+
msgbox_cancel_body,Sind Sie sicher
7373
msgbox_success_title,Erfolg
74-
msgbox_success_body,USB-Laufwerk erfolgreich geflasht!
74+
msgbox_success_body,USB-Laufwerk erfolgreich beschrieben!
7575
msgbox_error_title,Fehler
76-
msgbox_error_body,Fehler beim Flashen des USB-Laufwerks.
76+
msgbox_error_body,Fehler beim Schreiben auf das USB-Laufwerk.
7777
msgbox_no_image_title,Kein Abbild
7878
msgbox_no_image_body,Bitte wählen Sie zuerst eine gültige Installationsdatei aus.
7979
msgbox_no_device_title,Kein Gerät
@@ -87,7 +87,7 @@ msgbox_scan_error_title,Suchfehler
8787
msgbox_scan_error_body,Suche nach USB-Geräten fehlgeschlagen:
8888
no_usb_found,Keine USB-Geräte gefunden
8989
dlg_select_image_title,Abbild auswählen
90-
dlg_select_image_filter,"Abbilder (*.iso *.dmg *.img *.bin *.raw);;Alle Dateien (*)"
90+
dlg_select_image_filter,Abbilder (*.iso *.dmg *.img *.bin *.raw);;Alle Dateien (*)
9191
about_content,"lufus ist ein in Python geschriebener USB-Image-Writer für Linux.
9292
Inspiriert vom originalen lufus-Tool für Windows.
9393
Version: v1.0.0b1
@@ -103,25 +103,26 @@ combo_badblocks_2pass,2 Durchgänge
103103
combo_badblocks_3pass,3 Durchgänge
104104
status_unmounting_all,Alle Partitionen auf {device} werden ausgehängt...
105105
status_unmounting,{part} wird ausgehängt...
106+
status_remounting,Wird wieder eingehängt {part}...
106107
status_format_starting,Formatierungsvorgang wird gestartet...
107108
status_format_in_progress,Laufwerk wird formatiert...
108109
status_format_complete,Formatierung abgeschlossen!
109110
status_format_failed,Formatierung FEHLGESCHLAGEN. Prüfen Sie das obige Protokoll für den genauen Fehler.
110-
status_flash_error,Flash-Fehler: {error}
111+
status_flash_error,Schreibfehler: {error}
111112
acc_device,Geräteauswahl
112-
acc_device_desc,Wählen Sie das USB-Gerät, das Sie verwenden möchten
113+
acc_device_desc,Wählen Sie das USB-Gerät
113114
acc_refresh,Geräte aktualisieren
114115
acc_refresh_desc,Nach verbundenen USB-Geräten suchen
115116
acc_boot,Auswahl des Start-Images
116117
acc_boot_desc,Zeigt die aktuell ausgewählte Image-Datei
117118
acc_select,Nach Image-Datei suchen
118119
acc_image_option,Auswahl der Image-Option
119-
acc_image_option_desc,Wählen Sie den Typ des zu schreibenden Images: Windows, Linux, Sonstige oder Nur Formatieren
120+
acc_image_option_desc,Wählen Sie den Typ des zu schreibenden Images: Windows
120121
acc_volume_label,Eingabe der Volumenbezeichnung
121122
acc_volume_label_desc,Geben Sie einen Namen für das USB-Volumen ein
122123
acc_filesystem,Auswahl des Dateisystems
123124
acc_cluster,Auswahl der Clustergröße
124-
acc_flash_option,Auswahl der Flash-Methode
125+
acc_flash_option,Auswahl der Schreibmethode
125126
acc_quick_format,Checkbox für Schnellformatierung
126127
acc_extended_label,Checkbox für erweiterte Bezeichnung
127128
acc_bad_blocks,Checkbox zur Prüfung auf defekte Blöcke

src/lufus/gui/languages/English.csv

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ msgbox_scan_error_title,Scan Error
8787
msgbox_scan_error_body,Failed to scan for USB devices:
8888
no_usb_found,No USB devices found
8989
dlg_select_image_title,Select Disk Image
90-
dlg_select_image_filter,"Disk Images (*.iso *.dmg *.img *.bin *.raw);;All Files (*)"
90+
dlg_select_image_filter,Disk Images (*.iso *.dmg *.img *.bin *.raw);;All Files (*)
9191
about_content,"Lufus is a disk image writer written in Python for Linux.
9292
Inspired by the original Rufus tool for Windows.
9393
Version: v1.0.0b1
@@ -103,6 +103,7 @@ combo_badblocks_2pass,2 Pass
103103
combo_badblocks_3pass,3 Pass
104104
status_unmounting_all,Unmounting all partitions on {device}...
105105
status_unmounting,Unmounting {part}...
106+
status_remounting,Remounting {part}...
106107
status_format_starting,Starting format operation...
107108
status_format_in_progress,Formatting drive...
108109
status_format_complete,Format complete!
@@ -116,7 +117,7 @@ acc_boot,Boot image selector
116117
acc_boot_desc,Shows the currently selected image file
117118
acc_select,Browse for image file
118119
acc_image_option,Image option selector
119-
acc_image_option_desc,Choose the type of image to write: Windows, Linux, Other, or Format Only
120+
acc_image_option_desc,Choose the type of image to write: Windows
120121
acc_volume_label,Volume label input
121122
acc_volume_label_desc,Enter a name for the USB volume
122123
acc_filesystem,File system selector

src/lufus/gui/languages/Español.csv

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ lbl_partition_scheme,Esquema de partición
2020
lbl_target_system,Sistema objetivo
2121
lbl_volume_label,Etiqueta de volumen
2222
lbl_file_system,Sistema de archivos
23-
lbl_flash_option,Opciones de flasheo
23+
lbl_flash_option,Opción de grabación
2424
lbl_cluster_size,Tamaño del cluster
2525
combo_image_windows,Instalación estandar de Windows
2626
combo_image_linux,Instalación de Linux
27+
combo_image_other,Cualquier instalación (modo DD)
2728
combo_image_format,Solo formateo
2829
combo_partition_gpt,GPT
2930
combo_partition_mbr,MBR
@@ -32,14 +33,21 @@ combo_target_bios,BIOS (o UEFI-CSM)
3233
combo_cluster_4096,4096 bytes (Por defecto)
3334
combo_cluster_8192,8192 bytes
3435
combo_badblocks_1pass,1 pasada
35-
combo_flash_iso,Modo iso
36+
chk_quick_format,Formateo rápido
37+
chk_extended_label,Crear etiquetas extendidas y archivos de íconos
38+
chk_bad_blocks,Detectar bad blocks
39+
chk_verify_hash,Verificar suma SHA256
40+
lbl_expected_hash,SHA256 esperado:
41+
progress_verifying,Verificando suma SHA256...
42+
msgbox_verify_fail_title,Verificación fallida
43+
msgbox_verify_fail_body,¡La suma SHA256 no coincide! El archivo puede estar corrupto.
44+
msgbox_invalid_hash_title,Hash inválido
45+
msgbox_invalid_hash_body,El hash SHA256 proporcionado no es válido.
46+
combo_flash_iso,Modo ISO
3647
combo_flash_woe,Woe USB
3748
combo_flash_ventoy,Ventoy
3849
combo_flash_dd,DD
3950
combo_flash_none,Ninguno
40-
chk_quick_format,Formateo rápido
41-
chk_extended_label,Crear etiquetas extendidas y archivos de íconos
42-
chk_bad_blocks,Detectar bad blocks
4351
btn_select,Seleccionar
4452
btn_start,Empezar
4553
btn_cancel,Cancelar
@@ -51,7 +59,7 @@ tooltip_log,Log
5159
status_ready,Listo
5260
status_scanning,Escaneando por dispositivos USB...
5361
status_scan_failed,Escaneo fallido
54-
status_flashing,Flasheando...
62+
status_flashing,Grabando...
5563
progress_preparing,Preparando...
5664
progress_complete,Completado! 100%
5765
progress_failed,Fallido
@@ -63,9 +71,9 @@ progress_mount_done,Montado.. Completado! 100%
6371
msgbox_cancel_title,Cancelar
6472
msgbox_cancel_body,Estás seguro de que quieres cancelar?
6573
msgbox_success_title,Éxito
66-
msgbox_success_body,Dispositivo USB flasheado con éxito!
74+
msgbox_success_body,¡Dispositivo USB grabado con éxito!
6775
msgbox_error_title,Error
68-
msgbox_error_body,Flasheo de dispositivo USB fallido
76+
msgbox_error_body,Error al grabar en el dispositivo USB.
6977
msgbox_no_image_title,Sin imagen
7078
msgbox_no_image_body,Primero selecciona un archivo de instalación válido.
7179
msgbox_no_device_title,Sin dispositivo
@@ -86,25 +94,23 @@ about_content,"Lufus es una utilidad de escritura de discos para Linux hecha en
8694
Inspirado por la herramienta original Rufus para Windows.
8795
Version: v1.0.0b1
8896
GitHub: github.com/hog185/lufus"
89-
Traducción por/translation by: saber_03 :3
90-
91-
combo_badblocks_2pass,2 pasadas
92-
combo_badblocks_3pass,3 pasadas
93-
chk_verify_hash,Verificar suma SHA256
94-
input_hash_placeholder,Ingresa el hash SHA256 esperado aquí...
9597
about_subtitle,Herramienta de flash USB
9698
btn_close,Cerrar
9799
btn_ok,OK
98100
combo_boot_default,medios_de_instalación.iso
99101
tooltip_website,Sitio web
100102
settings_label_theme,Tema
103+
input_hash_placeholder,Ingresa el hash SHA256 esperado aquí...
104+
combo_badblocks_2pass,2 pasadas
105+
combo_badblocks_3pass,3 pasadas
101106
status_unmounting_all,Desmontando todas las particiones en {device}...
102107
status_unmounting,Desmontando {part}...
108+
status_remounting,Remontando {part}...
103109
status_format_starting,Iniciando operación de formateo...
104110
status_format_in_progress,Formateando disco...
105111
status_format_complete,¡Formateo completado!
106112
status_format_failed,Formateo FALLIDO. Comprueba el registro anterior para ver el error exacto.
107-
status_flash_error,Error de flasheo: {error}
113+
status_flash_error,Error de grabación: {error}
108114
acc_device,Selector de dispositivo
109115
acc_device_desc,Seleccione el dispositivo USB que desea usar
110116
acc_refresh,Actualizar dispositivos
@@ -113,7 +119,7 @@ acc_boot,Selector de imagen de arranque
113119
acc_boot_desc,Muestra el archivo de imagen seleccionado actualmente
114120
acc_select,Buscar archivo de imagen
115121
acc_image_option,Selector de tipo de imagen
116-
acc_image_option_desc,Elija el tipo de imagen a escribir: Windows, Linux, Otro, o Solo Formatear
122+
acc_image_option_desc,Elija el tipo de imagen a escribir: Windows
117123
acc_volume_label,Campo de etiqueta de volumen
118124
acc_volume_label_desc,Introduzca un nombre para el volumen USB
119125
acc_filesystem,Selector de sistema de archivos

0 commit comments

Comments
 (0)