Hello,
I use 3 languages in panel: de, fr and it. if I enter and save a text in the default language and then switch to another language and translate and save it there. if I then switch to another language and return again, the text default is displayed. however, it is saved correctly in .txt.
I don’t understand what I’m doing wrong.
blueprint
title: Page
preset: page
pages: false
options:
preview: false
changeTemplate: false
read:
admin: true
member: false
fields:
text:
label: Text
type: textarea
config
<?php
return [
'debug' => true,
'panel.install'=> true,
'languages' => true,
'community.markdown-field.buttons' => ['headlines', 'bold', 'italic', 'divider', 'link', 'email', 'pagelink', 'file', 'divider', 'ul', 'ol'],
'community.markdown-field.font' => [
'family' => 'sans-serif',
'scaling' => false,
'size' => 'regular',
],
'community.markdown-field.modals' => true,
'community.markdown-field.blank' => false,
'community.markdown-field.invisibles' => false,
'thumbs' => [
'driver' => 'gd',
'autoOrient' => true
],
'routes' => [
[
'pattern' => 'mitglied/(:any)',
'action' => function($user) {
$site = kirby()->site();
return tpl::load(kirby()->roots()->templates() . DS . 'member.php', array('user' => $user, 'site' => $site), false);
}
]
],
'hooks' => [
'route:before' => function ($route, $path, $method) {
if (Str::startsWith($path, 'api/pages') && $method == 'GET') {
$pagePath = str_replace('+', '/', str_replace('pages/', '', $route->arguments()[0]));
$page = kirby()->page($pagePath);
$user = kirby()->user();
if ($page && $user && $page->created()->toUser()) {
if($user->username() == "Admin")
{
return;
}
if ($user !== $page->created()->toUser())
{
throw new Exception('You cannot access this page');
}
}
}
}
]
];