Rename option panel.lang to panel.translation

This commit is contained in:
Giuseppe Criscione 2022-11-27 23:54:32 +01:00
parent fc2a9be244
commit 151841e4cf
4 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,7 @@ return [
'panel' => [
'enabled' => true,
'root' => 'panel',
'lang' => 'en',
'translation' => 'en',
'login_attempts' => 10,
'login_reset_time' => 300,
'logout_redirect' => 'login',

View File

@ -256,6 +256,8 @@ final class Panel
if ($this->isLoggedIn()) {
Formwork::instance()->translations()->setCurrent($this->user()->language());
} else {
Formwork::instance()->translations()->setCurrent(Formwork::instance()->config()->get('panel.translation'));
}
}

View File

@ -18,7 +18,7 @@
<?php
foreach (\Formwork\Panel\Panel::availableTranslations() as $key => $value):
?>
<option value="<?= $key ?>"<?php if ($key === $formwork->config()->get('panel.lang')): ?> selected<?php endif; ?>><?= $value ?></option>
<option value="<?= $key ?>"<?php if ($key === $formwork->config()->get('panel.translation')): ?> selected<?php endif; ?>><?= $value ?></option>
<?php
endforeach;
?>

View File

@ -26,7 +26,7 @@ layout:
panel:
collapsible: true
label: '{{panel.options.system.admin-panel}}'
fields: [panel.lang, panel.logout_redirect, panel.session_timeout, panel.color_scheme]
fields: [panel.translation, panel.logout_redirect, panel.session_timeout, panel.color_scheme]
images:
collapsible: true
@ -102,7 +102,7 @@ fields:
translate: [label]
required: true
panel.lang:
panel.translation:
type: select
label: '{{panel.options.system.admin-panel.default-language}}'
translate: [label]