A
A
Andrej Kopp2020-08-05 23:15:35
JavaScript
Andrej Kopp, 2020-08-05 23:15:35

How to localize CKEditor 5 Balloon Block?

Tell me, how can I localize the buttons of CKEditor 5 Balloon Block?

This is how I connect CKEditor:

<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/balloon-block/ckeditor.js"></script>
<script>
  const textarea = document.querySelector( '#editor' );
  BalloonEditor.create( textarea , {
        language: 'ru',
        removePlugins: [ 'Table' ],
        toolbar: [ 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote' ]
    })
    .then( editor => {
      window.editor = editor;
    } )
    .catch( error => {
      console.error( 'There was a problem initializing the editor.', error );
    } );

  document.getElementById( 'submit' ).onclick = () => {
      textarea.value = editor.getData();
  }
</script>


But the language does not change from English. The sources on github have a translations folder with translations into other languages.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrej Kopp, 2020-08-05
@sequelone

It turned out to be quite simple. It was necessary to connect the localization file:

<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/balloon-block/translations/ru.js"></script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question