Dotclear


Ignore:
Timestamp:
10/01/18 11:24:07 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Set correct lang attribute (useful for browser/editor spelling) for content (post/page) depending on entry setting, and CK editor UI in user language

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcCKEditor/_post_config.php

    r3769 r3897  
    108108<?php endif;?> 
    109109 
     110    CKEDITOR.config.defaultLanguage = dotclear.user_language; 
     111    CKEDITOR.config.language = dotclear.user_language; 
     112    CKEDITOR.config.contentsLanguage = dotclear.user_language; 
     113 
    110114<?php 
    111115if (!empty($extraPlugins) && count($extraPlugins) > 0) { 
     
    237241 
    238242    CKEDITOR.on('instanceLoaded',function(e) { 
    239  
    240243        // Retrieve textarea element of the instance, then its line-height (in px) and rows values, 
    241244        // then apply line-height * rows (min = 6) to the inner height of the instance. 
     
    250253            } 
    251254        } 
    252  
    253255    }); 
    254256 
     
    268270        }); 
    269271 
     272        const ta = document.getElementById(e.editor.name); 
     273        if (ta !== undefined) { 
     274            if (ta.lang && e.editor.config.contentsLanguage !== ta.lang) { 
     275                let config = e.editor.config; 
     276                config.contentsLanguage = ta.lang; 
     277                e.editor.destroy(); 
     278                CKEDITOR.replace(e.editor.name, config); 
     279            } 
     280        } 
    270281    }); 
    271282 
Note: See TracChangeset for help on using the changeset viewer.

Sites map