From e4d97b16d47546e84438c8dff84fea343fb410fe Mon Sep 17 00:00:00 2001 From: Ahmet Bora Date: Wed, 13 Nov 2024 22:21:43 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Bastian Allgeier --- src/Cms/Language.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cms/Language.php b/src/Cms/Language.php index 68b75c851c..9082095819 100644 --- a/src/Cms/Language.php +++ b/src/Cms/Language.php @@ -77,7 +77,7 @@ public function __construct(array $props) $this->locale = [LC_ALL => $this->code]; } - $this->variables = new LanguageVariables($this, $props['translations'] ?? []); + $this->variables = new LanguageVariables($this, $props['variables'] ?? $props['translations'] ?? []); } /** @@ -132,7 +132,7 @@ public function clone(array $props = []): static 'name' => $this->name, 'slugs' => $this->slugs, 'smartypants' => $this->smartypants, - 'translations' => $this->variables->toArray(), + 'variables' => $this->variables->toArray(), 'url' => $this->url, ], $props)); } @@ -484,7 +484,7 @@ public function save(): static 'direction' => $this->direction(), 'locale' => Locale::export($this->locale()), 'name' => $this->name(), - 'translations' => $this->variables()->toArray(), + 'variables' => $this->variables()->toArray(), 'url' => $this->url, ];