diff --git a/src/CkEditor.php b/src/CkEditor.php index 7ce846b..af09b10 100755 --- a/src/CkEditor.php +++ b/src/CkEditor.php @@ -101,13 +101,18 @@ public function __construct($name, $attribute = null, callable $resolveCallback $config = config('nova-ckeditor'); + $defaultTextPartLanguage = [ + ['title' => 'Farsi', 'languageCode' => 'fa'], + ['title' => 'English', 'languageCode' => 'en'] + ]; + $this->toolbar = $config['toolbar']['items']; $this->height = $config['toolbar']['height']; $this->imageBrowser = $config['toolbar']['browser']['image']; $this->videoBrowser = $config['toolbar']['browser']['video']; $this->snippetBrowser = $this->prepareSnippets($config['toolbar']['snippets']); $this->contentLanguage = $config['toolbar']['content-lang']; - $this->textPartLanguage = $config['toolbar']['text-part-language']; + $this->textPartLanguage = $config['toolbar']['text-part-language'] ?? $defaultTextPartLanguage; $this->uiLanguage = $config['toolbar']['ui-language']['name'] ?? 'en'; $this->shouldNotGroupWhenFull = $config['toolbar']['should-not-group-when-full']; $this->videoModel = $config['video-model'];