Centralize language loading with English fallback (#361)

This commit is contained in:
Fabian
2026-07-31 06:12:33 +01:00
committed by GitHub
parent 4f9bc3c37c
commit a1a714b062
19 changed files with 260 additions and 40 deletions
+3 -7
View File
@@ -60,12 +60,8 @@ include_once("Form.php");
include_once("Generator.php");
include_once("Multisort.php");
include_once("Ranking.php");
include_once("Lang/" . LANG . ".php");
// en.php is an idempotent fallback (tz_def only defines missing keys); loading
// it after the player language guarantees every interface constant is defined,
// so a key missing from a translation degrades to English instead of a PHP 8.3
// "undefined constant" fatal (blank page). See issue #189.
include_once("Lang/en.php");
require_once __DIR__ . "/Lang/loader.php";
tz_load_language(LANG);
include_once("Logging.php");
include_once("Message.php");
include_once("Alliance.php");
@@ -585,4 +581,4 @@ if (!empty($_SESSION['id_user'])) {
$message = new Message;
$user = new User((int)$_SESSION['id_user'], $database);
}
?>
?>