Skip to content

Commit

Permalink
Merge pull request #99 from marijoo/main
Browse files Browse the repository at this point in the history
Fix adding Translatable to Panels
  • Loading branch information
freekmurze authored Nov 27, 2023
2 parents bc38077 + 36c44a3 commit cd3389c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ protected function createTranslatedField(Field $originalField, string $locale):
$translatedField
->resolveUsing(function ($value, Model $model) use ($translatedField, $locale, $originalAttribute) {
$translatedField->attribute = 'translations_'.$originalAttribute.'_'.$locale;
$translatedField->panel = $this->panel;
$translatedField->assignedPanel = $this->assignedPanel;
$translatedField->panel = $translatedField->panel ?? $this->panel;
$translatedField->assignedPanel = $translatedField->assignedPanel ?? $this->assignedPanel;

return $model->translations[$originalAttribute][$locale] ?? '';
});
Expand Down

0 comments on commit cd3389c

Please sign in to comment.