From cba61aa0b149a67e7c0d9e42369695da39aaedbf Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Tue, 28 Mar 2023 11:58:39 +0200 Subject: [PATCH] IBX-5377: Added language of edited content to CKE configuration (#80) --- src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js index b9e80b39..908c90bc 100644 --- a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js +++ b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js @@ -120,6 +120,7 @@ const VIEWPORT_TOP_OFFSET = 102; const wrapper = this.getHTMLDocumentFragment(container.closest('.ibexa-data-source').querySelector('textarea').value); const section = wrapper.childNodes[0]; const { toolbar, extraPlugins = [] } = window.ibexa.richText.CKEditor; + const locale = new Intl.Locale(doc.querySelector('meta[name="LanguageCode"]').content); const blockCustomStyles = Object.entries(ibexa.richText.customStyles) .filter(([, customStyleConfig]) => !customStyleConfig.inline) .map(([customStyleName, customStyleConfig]) => { @@ -205,6 +206,9 @@ const VIEWPORT_TOP_OFFSET = 102; table: { contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells'], }, + language: { + content: locale.language, + }, }).then((editor) => { this.editor = editor; const initialData = this.getData();