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 <mail@bastianallgeier.com>
  • Loading branch information
afbora and bastianallgeier authored Nov 13, 2024
1 parent 1628be7 commit b56dad6
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 @@ -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'] ?? []);
}

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

Expand Down

0 comments on commit b56dad6

Please sign in to comment.