Hello,
I’m using the cookieconsent plugin Cookieconsent | Kirby CMS Plugins and am trying to make the translations editable in the panel.
I added a tab to the site.yml like this
cookieConsent:
icon: toggle-on
label: Consent Modal Translations
fields:
consentDescription:
label: Description
type: textarea
and filled the field in the panel for english with
Further information can be found in our (link: page://yduc2QcEZrWyQYpG text: privacy policy).
and german with
Weitere Informationen finden Sie in unserer (link: page://yduc2QcEZrWyQYpG text: Datenschutzerklärung).
The link was obviously created by the Link button of the textarea.
Similar to the README I added to config.php:
'zephir.cookieconsent' => [
'translations' => require_once(__DIR__.'/../cc-translations/translations.php'),
],
and overwrite the description like this in translations.php:
<?php
$pageEn = site()->content('en');
$pageDe = site()->content('de');
return
[
'en' => array_replace_recursive(
require(__DIR__ . '/../plugins/kirby-cookieconsent/translations/en.php'),
[
"consentModal" => [
"description" => $pageEn->consentdescription()->kt()->toString(),
]
]
),
'de' =>array_replace_recursive(
require(__DIR__ . '/../plugins/kirby-cookieconsent/translations/de.php'),
[
'consentModal' => [
"description" => $pageDe->consentdescription()->kt()->toString(),
]
]
)
];
This works so far. The issue is, that the link for both languages leads to the german page /privacy. The english link is not /en/privacy as expected, but also /privacy.
Do you have an idea why that happens?
I already found out, that I have to add lang: en to the (link:… but I expected it to work out of the box.