Skip to content

Commit

Permalink
IBX-5377: Added language of edited content to CKE configuration (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
dew326 authored Mar 28, 2023
1 parent bf45e57 commit cba61aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]) => {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit cba61aa

Please sign in to comment.