From 4b7062e0bd45abf4506e34237373154263c1f3ac Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 21 Jan 2026 11:19:48 +0100 Subject: [PATCH] Fix thanks and error page routing for both languages - Add dedicated routes for /thanks, /error, /en/thanks, and /en/error - Create missing error.en.txt content file - Add title to error.fr.txt Co-Authored-By: Claude Sonnet 4.5 --- content/error/error.en.txt | 5 +++++ content/error/error.fr.txt | 6 +++++- site/config/config.php | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 content/error/error.en.txt diff --git a/content/error/error.en.txt b/content/error/error.en.txt new file mode 100644 index 0000000..e7a7a4d --- /dev/null +++ b/content/error/error.en.txt @@ -0,0 +1,5 @@ +Title: Error + +---- + +Template: default diff --git a/content/error/error.fr.txt b/content/error/error.fr.txt index 1301277..986fe1a 100644 --- a/content/error/error.fr.txt +++ b/content/error/error.fr.txt @@ -1 +1,5 @@ -Uuid: kcrqkszqasludg2h \ No newline at end of file +Title: Erreur + +---- + +Uuid: kcrqkszqasludg2h diff --git a/site/config/config.php b/site/config/config.php index 3da6162..5023f17 100644 --- a/site/config/config.php +++ b/site/config/config.php @@ -37,6 +37,44 @@ return [ return null; } ], + // English thanks page + [ + 'pattern' => 'en/thanks', + 'action' => function() { + $thanks = page('thanks'); + if ($thanks) { + site()->visit($thanks, 'en'); + return $thanks; + } + return null; + } + ], + // English error page + [ + 'pattern' => 'en/error', + 'action' => function() { + $error = page('error'); + if ($error) { + site()->visit($error, 'en'); + return $error; + } + return null; + } + ], + // French thanks page + [ + 'pattern' => 'thanks', + 'action' => function() { + return page('thanks'); + } + ], + // French error page + [ + 'pattern' => 'error', + 'action' => function() { + return page('error'); + } + ], // French products (default) [ 'pattern' => '(:any)',