Hello,
I have setup the Kirby uniform plugin the “ajax way” with routing via the config.php and got everything working except for the error messages in multi languages. I have two languages on my site, Swedish and English and Swedish is the default.
This is a bit of code example from my config.php:
[ 'pattern' => '/(:all)',
'method' => 'POST',
'action' => function () {
$form = new \Uniform\Form([
'email' => [
'rules' => ['required', 'email'],
'message' => t('contact_form_error_email'),
],
'recipient' => [
'rules' => ['required'],
'message' => t('contact_form_error_recipient'),
],
…
As you can see I use language variables as error messages but it only works with the default language. When switching over to english on the website and trying again it still displays the default language swedish for error messages. I am using language variables all over the site and they all work except within this plugin.
Am I doing it wrong? I have tried to search for similiar problems in the forum but can’t find a solution. Hope someone can help.
Thanks!