Skip to content

Commit

Permalink
fix: thank you message translation (#59)
Browse files Browse the repository at this point in the history
* fix thank you message translation

currently the `mauricerenck.komments.thankyou` message is always shown in the default language, no matter what the current language is.
maybe related to `t()` helper not working in this context.
fix by using `I18n::template()` instead.

* Update index.php

use `translate()` instead of `template()`, as suggested here: #59 (comment)
  • Loading branch information
hariom147 authored Sep 21, 2023
1 parent 3d227a6 commit f4cbfa3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use mauricerenck\Komments\KommentReceiver;
use Kirby;
use Kirby\Http\Response;
use Kirby\Toolkit\I18n;

@include_once __DIR__ . '/vendor/autoload.php';

Expand Down Expand Up @@ -70,7 +71,7 @@
$response = [
'status' => 'success',
'pending' => true,
'message' => t('mauricerenck.komments.thankyou'),
'message' => I18n::translate('mauricerenck.komments.thankyou', null , kirby()->languageCode()),
'data' => $webmention
];

Expand Down

0 comments on commit f4cbfa3

Please sign in to comment.