add translations

This commit is contained in:
amazuecos
2025-03-02 12:29:01 +01:00
parent 3140e527e8
commit 18700b6c96
3 changed files with 41 additions and 31 deletions

View File

@ -39,6 +39,11 @@ return [
'need_editor_to_save' => 'Need to be in edit mode to save the content.', 'need_editor_to_save' => 'Need to be in edit mode to save the content.',
'no_content' => 'Page is empty', 'no_content' => 'Page is empty',
'dropdown_roles' => 'Roles that can see this section', 'dropdown_roles' => 'Roles that can see this section',
'save_content' => 'Save contents',
'delete_section' => 'Delete section',
'roles' => 'Roles',
'multiple_select_role' => 'Select one or multiple roles'
]; ];

View File

@ -45,6 +45,10 @@ return [
'need_editor_to_save' => 'Tienes que estar en modo editar para guardar.', 'need_editor_to_save' => 'Tienes que estar en modo editar para guardar.',
'no_content' => 'No hay contenido en la página', 'no_content' => 'No hay contenido en la página',
'dropdown_roles' => 'Roles que pueden ver la sección', 'dropdown_roles' => 'Roles que pueden ver la sección',
'save_content' => 'Guardar contenido',
'delete_section' => 'Eliminar sección',
'roles' => 'Roles',
'multiple_select_role' => 'Selecciona uno o varios roles',
'select_icon' => 'Selecciona un icono',
]; ];

View File

@ -25,8 +25,7 @@ class WikiEditor extends TranslationHelper{
this.wikiFormSection = new WikiSectionForm() this.wikiFormSection = new WikiSectionForm()
this.wikiFormSection.setId(this.sectionId) this.wikiFormSection.setId(this.sectionId)
} }
async initEditor() async initEditor() {
{
this.wikiFormSection.init() this.wikiFormSection.init()
await this.get_translations("Wiki") await this.get_translations("Wiki")
@ -107,8 +106,7 @@ class WikiEditor extends TranslationHelper{
}, },
}) })
} }
async initViewOnly() async initViewOnly() {
{
try { try {
await this.initEditor() await this.initEditor()
await this.editor.isReady; await this.editor.isReady;
@ -120,6 +118,8 @@ class WikiEditor extends TranslationHelper{
async init() { async init() {
try { try {
await this.initEditor() await this.initEditor()
$('#release-editor').attr('disabled', 'disabled')
$('#save-editor').attr('disabled', 'disabled')
await this.editor.isReady; await this.editor.isReady;
new DragDrop(this.editor); new DragDrop(this.editor);
/** Do anything you need after editor initialization */ /** Do anything you need after editor initialization */
@ -147,6 +147,7 @@ class WikiEditor extends TranslationHelper{
}) })
}) })
$('#preview-editor').on('click', () => { $('#preview-editor').on('click', () => {
this.editor.readOnly.toggle() this.editor.readOnly.toggle()
$('#edit-editor').removeClass('d-none') $('#edit-editor').removeClass('d-none')
@ -155,12 +156,12 @@ class WikiEditor extends TranslationHelper{
$('#save-editor').attr('disabled', 'disabled') $('#save-editor').attr('disabled', 'disabled')
}) })
$('#edit-editor').on('click', () => { $('#edit-editor').on('click', () => {
this.editor.readOnly.toggle()
$('#edit-editor').addClass('d-none') $('#edit-editor').addClass('d-none')
$('#preview-editor').removeClass('d-none') $('#preview-editor').removeClass('d-none')
$('#release-editor').attr('disabled', null) $('#release-editor').attr('disabled', null)
$('#save-editor').attr('disabled', null) $('#save-editor').attr('disabled', null)
this.editor.readOnly.toggle()
}) })
this.handleGetData(); this.handleGetData();
} catch (reason) { } catch (reason) {