javascript - How set language ckeditor by html attribute? -
i can language set javascript code
<script type="text/javascript"> ckeditor.config.language = "fr"; </script>
i had idea set lang this?
<textarea name="name" id="name" cols="30" rows="10" data-lang="fr"></textarea>
the following 1 should (+ fiddle):
ckeditor.on( 'instancecreated', function( evt ) { var editor = evt.editor, element = editor.element, lang = element.data( 'lang' ); if ( lang ) evt.editor.config.language = lang; });
Comments
Post a Comment