Skip to content

Commit e4d97b1

Browse files
Apply suggestions from code review
Co-authored-by: Bastian Allgeier <[email protected]>
1 parent 14195e3 commit e4d97b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Cms/Language.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function __construct(array $props)
7777
$this->locale = [LC_ALL => $this->code];
7878
}
7979

80-
$this->variables = new LanguageVariables($this, $props['translations'] ?? []);
80+
$this->variables = new LanguageVariables($this, $props['variables'] ?? $props['translations'] ?? []);
8181
}
8282

8383
/**
@@ -132,7 +132,7 @@ public function clone(array $props = []): static
132132
'name' => $this->name,
133133
'slugs' => $this->slugs,
134134
'smartypants' => $this->smartypants,
135-
'translations' => $this->variables->toArray(),
135+
'variables' => $this->variables->toArray(),
136136
'url' => $this->url,
137137
], $props));
138138
}
@@ -484,7 +484,7 @@ public function save(): static
484484
'direction' => $this->direction(),
485485
'locale' => Locale::export($this->locale()),
486486
'name' => $this->name(),
487-
'translations' => $this->variables()->toArray(),
487+
'variables' => $this->variables()->toArray(),
488488
'url' => $this->url,
489489
];
490490

0 commit comments

Comments
 (0)