From 70b64754af05ad70cc958f830838c858b6745b15 Mon Sep 17 00:00:00 2001 From: fkDead Date: Thu, 26 Nov 2026 14:00:07 +0100 Subject: [PATCH] feat(installer): show the end-of-install dialogs in the chosen language The dialogs shown before a language is picked (low memory, waiting screen) are in English, the fallback language of the translations. --- configs/baseline/airootfs/root/.xinitrc | 77 +++++++++++++++---------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/configs/baseline/airootfs/root/.xinitrc b/configs/baseline/airootfs/root/.xinitrc index a7301ad..0fc888c 100644 --- a/configs/baseline/airootfs/root/.xinitrc +++ b/configs/baseline/airootfs/root/.xinitrc @@ -40,8 +40,9 @@ if command -v liveinst >/dev/null 2>&1; then # laisser l'utilisateur croire à un bug. _MEMKB=$(awk '/^MemTotal:/{print $2}' /proc/meminfo 2>/dev/null) if [ -n "$_MEMKB" ] && [ "$_MEMKB" -lt 2000000 ] && command -v zenity >/dev/null 2>&1; then - zenity --warning --width=460 --title="FWS — mémoire insuffisante ?" \ - --text="Cette machine n'a que $(( _MEMKB / 1024 )) Mo de RAM.\n\nL'installateur graphique peut geler en dessous de 2 Go.\nEn VM : augmente la mémoire (4 Go recommandés) puis redémarre.\n\nOK pour tenter quand même." 2>/dev/null + # Shown before the user picks a language: English, like the splash below. + zenity --warning --width=460 --title="FWS — not enough memory?" \ + --text="This machine only has $(( _MEMKB / 1024 )) MB of RAM.\n\nThe graphical installer may freeze below 2 GB.\nIn a virtual machine: raise the memory (4 GB recommended), then restart.\n\nOK to try anyway." 2>/dev/null fi # ÉCRAN D'ATTENTE immédiat : le démarrage d'anaconda peut prendre 2 à @@ -77,7 +78,7 @@ if command -v liveinst >/dev/null 2>&1; then _el=$(( _el + 3 )) _last=$(ls -t /tmp/storage.log /tmp/anaconda.log /tmp/program.log /tmp/dbus.log 2>/dev/null | head -n1) if [ -z "$_last" ]; then - printf '# Démarrage d'"'"'Anaconda… (%d min %02d s)\n' $(( _el / 60 )) $(( _el % 60 )) || exit 0 + printf '# Starting the installer… (%d min %02d s)\n' $(( _el / 60 )) $(( _el % 60 )) || exit 0 continue fi _stamp=$(stat -c %Y "$_last" 2>/dev/null) @@ -93,24 +94,24 @@ if command -v liveinst >/dev/null 2>&1; then | cut -c1-90) if [ "$_quiet" -ge 240 ] && [ ! -f /tmp/fws-stall.txt ]; then { - echo "=== FWS : préparation bloquée (aucune activité log depuis ${_quiet}s) ===" - echo "--- dernier log actif : $_last"; tail -n 25 "$_last" 2>/dev/null - echo "--- udev (workers bloqués ?)"; udevadm settle --timeout=0 2>&1 - echo "--- journal (fin)"; journalctl -b --no-pager 2>/dev/null | tail -n 60 - echo "--- dmesg (fin)"; dmesg 2>/dev/null | tail -n 40 + echo "=== FWS: preparation stalled (no log activity for ${_quiet}s) ===" + echo "--- last active log: $_last"; tail -n 25 "$_last" 2>/dev/null + echo "--- udev (stuck workers?)"; udevadm settle --timeout=0 2>&1 + echo "--- journal (end)"; journalctl -b --no-pager 2>/dev/null | tail -n 60 + echo "--- dmesg (end)"; dmesg 2>/dev/null | tail -n 40 } > /tmp/fws-stall.txt 2>&1 - zenity --text-info --title="FWS — préparation bloquée : diagnostic" \ + zenity --text-info --title="FWS — preparation stalled: diagnostics" \ --filename=/tmp/fws-stall.txt --width=1000 --height=650 2>/dev/null & fi if [ "$_quiet" -ge 60 ]; then - printf '# ⚠ Aucune activité depuis %d s (%s) — dernier message : %s\n' "$_quiet" "$(basename "$_last")" "$_msg" || exit 0 + printf '# ⚠ No activity for %d s (%s) — last message: %s\n' "$_quiet" "$(basename "$_last")" "$_msg" || exit 0 else - printf '# Préparation (%d min %02d s) — %s : %s\n' $(( _el / 60 )) $(( _el % 60 )) "$(basename "$_last")" "$_msg" || exit 0 + printf '# Preparing (%d min %02d s) — %s: %s\n' $(( _el / 60 )) $(( _el % 60 )) "$(basename "$_last")" "$_msg" || exit 0 fi done ) | zenity --progress --pulsate --no-cancel \ --title="FWS" \ - --text="Préparation de l'installateur FWS…\n\nAnalyse du matériel et des disques en cours.\nEncore une à deux minutes, c'est normal." \ + --text="Preparing the FWS installer…\n\nChecking the hardware and the disks.\nOne or two more minutes: this is normal." \ --width=560 2>/dev/null & _SPLASH_PID=$! fi @@ -160,6 +161,13 @@ if command -v liveinst >/dev/null 2>&1; then fi pkill -f "fws-stall.txt" 2>/dev/null + # The installer has closed: the dialogs below speak the language picked on + # its first screen (saved by fws_wizard.py), not the live's default. + if [ -s /tmp/fws-lang ]; then + LANG="$(cat /tmp/fws-lang)" + export LANG + fi + # ATTENTION : liveinst NE propage PAS le code de sortie d'anaconda — il # enchaîne son propre nettoyage et sort souvent 0 même quand anaconda a # planté. On ne se fie donc PAS à $rc : en phase debug on regroupe TOUS les @@ -191,33 +199,33 @@ if command -v liveinst >/dev/null 2>&1; then DBG=/tmp/fws-debug.txt { - echo "===== liveinst sorti (code $rc) — logs Anaconda =====" + echo "===== liveinst exited (code $rc) — Anaconda logs =====" echo - echo "########## sortie liveinst (stdout+stderr) ##########" + echo "########## liveinst output (stdout+stderr) ##########" cat "$LIVEINST_LOG" 2>/dev/null echo - echo "########## %post chrooté = grub-install / mkinitcpio ##########" - echo "########## >>> C'EST CE BLOC QUI DIT SI LE DISQUE VA BOOTER <<< ##########" - cat /tmp/fws-post-chroot.log 2>/dev/null || echo "(log introuvable)" + echo "########## chroot %post = grub-install / mkinitcpio ##########" + echo "########## >>> THIS BLOCK TELLS WHETHER THE DISK WILL BOOT <<< ##########" + cat /tmp/fws-post-chroot.log 2>/dev/null || echo "(log not found)" echo echo "########## %post --nochroot (/tmp/fws-post-nochroot.log) ##########" - cat /tmp/fws-post-nochroot.log 2>/dev/null || echo "(absent)" + cat /tmp/fws-post-nochroot.log 2>/dev/null || echo "(missing)" echo - echo "########## Récapitulatif (page GUI fws_recap, avant install) ##########" - cat /tmp/fws-hw-summary.txt 2>/dev/null || echo "(absent — page récap pas atteinte)" + echo "########## Summary (fws_recap screen, before installing) ##########" + cat /tmp/fws-hw-summary.txt 2>/dev/null || echo "(missing — summary screen not reached)" # The crash dialog only shows the dasbus wrapper frames; the actual # remote exception is at the end of this dump, and nowhere else. for f in /tmp/anaconda-tb-*; do [ -f "$f" ] || continue echo - echo "########## $f (traceback Anaconda, fin) ##########" + echo "########## $f (Anaconda traceback, end) ##########" tail -n 80 "$f" done for f in /tmp/anaconda.log /tmp/syslog /tmp/program.log \ /tmp/storage.log /tmp/dbus.log /tmp/packaging.log /tmp/X.log; do echo echo "########## $f ##########" - tail -n 200 "$f" 2>/dev/null || echo "(absent)" + tail -n 200 "$f" 2>/dev/null || echo "(missing)" done } >"$DBG" 2>&1 @@ -231,8 +239,8 @@ if command -v liveinst >/dev/null 2>&1; then if grep -q 'Initcpio image generation successful' /tmp/fws-post-chroot.log 2>/dev/null \ && grep -q 'Installation finished. No error reported.' /tmp/fws-post-chroot.log 2>/dev/null; then if command -v zenity >/dev/null 2>&1; then - zenity --info --width=480 --title="FWS — installation réussie ✅" \ - --text="FWS est installé sur le disque.\n\n1. Clique OK pour éteindre la machine.\n2. Retire l'ISO (lecteur CD/DVD).\n3. Rallume → FWS démarre." \ + zenity --info --width=480 --title="$(fws-i18n session.success_title)" \ + --text="$(fws-i18n session.success_text)" \ 2>/dev/null fi systemctl poweroff @@ -252,15 +260,22 @@ if command -v liveinst >/dev/null 2>&1; then # logs de la machine, ça ne part pas sans un clic. if command -v zenity >/dev/null 2>&1; then ( + # zenity prints the clicked label: compare with the very same + # translated strings. + _close="$(fws-i18n session.close)" + _send="$(fws-i18n session.send_report)" + _reboot="$(fws-i18n session.reboot)" while :; do _btn="$(zenity --text-info \ - --title="FWS — l'installation ne s'est pas terminée (sortie $rc)" \ + --title="$(fws-i18n session.failure_title code="$rc")" \ --filename="$DBG" --width=1100 --height=720 \ - --ok-label="Fermer" \ - --extra-button="Envoyer le rapport aux développeurs" \ - --extra-button="Redémarrer" 2>/dev/null)" || true + --ok-label="$_close" \ + --extra-button="$_send" \ + --extra-button="$_reboot" 2>/dev/null)" || true case "$_btn" in - "Envoyer le rapport aux développeurs") + # Window closed (empty answer): never mistake it for a button. + "") break ;; + "$_send") # fws-bugreport pré-charge le fichier de debug, # montre le payload EXACT et n'envoie que sur # confirmation — la télémétrie reste au choix de @@ -272,10 +287,10 @@ if command -v liveinst >/dev/null 2>&1; then fws-bugreport --file "$DBG" >/dev/null 2>&1 || true else zenity --error --width=440 \ - --text="fws-bugreport est absent de cette image :\nle rapport ne peut pas être envoyé d'ici." 2>/dev/null || true + --text="$(fws-i18n session.bugreport_missing)" 2>/dev/null || true fi ;; - "Redémarrer") + "$_reboot") systemctl reboot break ;;