diff --git a/src/Components/TinyEditor.php b/src/Components/TinyEditor.php index 58a8cab..ebe82c9 100644 --- a/src/Components/TinyEditor.php +++ b/src/Components/TinyEditor.php @@ -29,7 +29,7 @@ class TinyEditor extends Field implements Contracts\CanBeLengthConstrained, Cont protected string $toolbar; - protected string $language; + protected string|\Closure $language; protected bool $toolbarSticky = false; @@ -80,7 +80,7 @@ public function getFileAttachmentsDirectory(): ?string public function getInterfaceLanguage(): string { - return match ($this->language) { + return match ($this->evaluate($this->language)) { 'ar' => 'ar', 'az' => 'az', 'bg' => 'bg_BG', @@ -262,7 +262,7 @@ public function isSimple(): bool return (bool) $this->evaluate($this->isSimple); } - public function language(string $language): static + public function language(string|\Closure $language): static { $this->language = $language;