Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Bastian Allgeier <[email protected]>
  • Loading branch information
afbora and bastianallgeier committed Dec 9, 2024
1 parent 14195e3 commit e4d97b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Cms/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ?? []);
}

/**
Expand Down Expand Up @@ -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));
}
Expand Down Expand Up @@ -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,
];

Expand Down

0 comments on commit e4d97b1

Please sign in to comment.