aboutsummaryrefslogtreecommitdiff
path: root/webroot
diff options
context:
space:
mode:
authorwinter Sparkles2026-08-08 23:33:27 +0100
committerwinter Sparkles2026-08-08 23:33:27 +0100
commit4bb659e1f7bb5850db5695a536428a9b71e3ffe5 (patch)
tree749e41db42f9f5a08e2342e65e660ac5e59c46f7 /webroot
parentb422b6ded608807c7d3bb8b965b3797ca513610b (diff)
tidy up the localisation stuff
Diffstat (limited to 'webroot')
-rw-r--r--webroot/index.php21
1 files changed, 6 insertions, 15 deletions
diff --git a/webroot/index.php b/webroot/index.php
index 729cdf2..dd8a6d9 100644
--- a/webroot/index.php
+++ b/webroot/index.php
@@ -30,32 +30,23 @@ $router = new Psso\Router('../routes', $config);
$router->registerStatusHandler(404, function ($path) {
$resp = new Psso\XMLResponse;
- $resp->doc->addAttribute('title', 'Not found');
- $resp->doc->addChild(
- 'error',
- "The requested page ($path) does not exist."
- );
+ $resp->doc->addAttribute('title', L('error.not-found'));
+ $resp->doc->addChild('error', L('error.not-found.long', $path));
$resp->send();
});
$router->registerStatusHandler(405, function ($path) {
$method = $_SERVER['REQUEST_METHOD'];
$resp = new Psso\XMLResponse;
- $resp->doc->addAttribute('title', 'Wrong method');
- $resp->doc->addChild(
- 'error',
- "Your request method ($method) is not valid for this path."
- );
+ $resp->doc->addAttribute('title', L('error.wrong-method'));
+ $resp->doc->addChild('error', L('error.wrong-method.long', $method));
$resp->send();
});
$router->setExceptionHandler(function (Throwable $e) {
$resp = new Psso\XMLResponse;
- $resp->doc->addAttribute('title', 'Uncaught exception');
- $resp->doc->addChild(
- 'error',
- $e::class . ': ' . $e->getMessage()
- );
+ $resp->doc->addAttribute('title', L('error.uncaught'));
+ $resp->doc->addChild('error', $e::class . ': ' . $e->getMessage());
$resp->send();
error_log($e);
});