From cca91dfeab87c689b56b33c2b88b325d04f34bde Mon Sep 17 00:00:00 2001 From: billz Date: Fri, 28 Nov 2025 09:54:01 +0100 Subject: [PATCH] Fix: re-apply locale settings template context --- templates/wifi_stations/network.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/wifi_stations/network.php b/templates/wifi_stations/network.php index c3db54f5..20e2e14b 100644 --- a/templates/wifi_stations/network.php +++ b/templates/wifi_stations/network.php @@ -3,6 +3,15 @@ use RaspAP\Networking\Hotspot\WiFiManager; $wifi = new WiFiManager(); +// fix: re-apply locale settings in this template context +if (!empty($_SESSION['locale'])) { + putenv("LANG=" . $_SESSION['locale']); + setlocale(LC_ALL, $_SESSION['locale']); + bindtextdomain('messages', realpath(__DIR__ . '/../../locale')); + bind_textdomain_codeset('messages', 'UTF-8'); + textdomain('messages'); +} + // set defaults $network = $network ?? []; $network['ssid'] = $network['ssid'] ?? '';