mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 18:28:49 +02:00
Set the language of the CKEDITOR5 elements based on the page locale.
This commit is contained in:
parent
63b7e0458c
commit
b18284cfd7
3 changed files with 19 additions and 7 deletions
|
@ -28,7 +28,11 @@ export default class extends Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
EDITOR_TYPE.create(this.element)
|
||||
const language = document.body.dataset.locale ?? "en";
|
||||
|
||||
EDITOR_TYPE.create(this.element, {
|
||||
language: language,
|
||||
})
|
||||
.then(editor => {
|
||||
if(this.element.disabled) {
|
||||
editor.enableReadOnlyMode("readonly");
|
||||
|
@ -39,8 +43,8 @@ export default class extends Controller {
|
|||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
/* const watchdog = new EditorWatchdog();
|
||||
/*
|
||||
const watchdog = new EditorWatchdog();
|
||||
watchdog.setCreator((elementOrData, editorConfig) => {
|
||||
return EDITOR_TYPE.create(elementOrData, editorConfig)
|
||||
.then(editor => {
|
||||
|
@ -56,7 +60,8 @@ export default class extends Controller {
|
|||
});
|
||||
|
||||
watchdog.create(this.element, {
|
||||
|
||||
});*/
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
}); */
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue