From b56dad65b927118032e38ccb4c4e423ab30b76f3 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 dd30026d7e..c4dfbb3aa6 100644 --- a/src/Cms/Language.php +++ b/src/Cms/Language.php @@ -76,7 +76,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'] ?? []); } /** @@ -131,7 +131,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)); } @@ -487,7 +487,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, ];