Opened 3 years ago

Closed 3 years ago

#13906 closed Bug (invalid)

Configuration of format-switch failed

Reported by: Sönke Sprink Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Steps to reproduce

Install CKEditor, put the following code in config.js into the body of following function:

CKEDITOR.editorConfig = function( config ) {

config.format_pNormal = { name: 'Vorspann', element: 'p', attributes: { 'class': 'pbb-intro' } };

config.format_h4 = { name: 'Zwischenüberschrift', element: 'h4', attributes: { 'class': 'pbb-heading4' } };

config.format_h5 = { name: 'Zwischenüberschrift 2', element: 'h5', attributes: { 'class': 'pbb-heading5' } };

Set the most common block elements.

config.format_tags = 'p;h4;h5;pNormal';

}

Expected result

Now the format-Switch should show entries for p, h4, h5 and p (with additional class), with the shown names:

  • Normal
  • Zwischenüberschrift
  • Zwischenüberschrift 2
  • Vorspann

Actual result

But the switch shows the entries p, h4, h5, p (correct!) but with wrong names:

  • Normal
  • Überschrift 4
  • Überschrift 5
  • Vorspann

Other details (browser, OS, CKEditor version, installed plugins)

Tested in Chrome, FF, IE on Windows and Chrome and FF on OSX

Attachments (1)

editor-pm-frontend.png (49.7 KB) - added by Sönke Sprink 3 years ago.
Screenshot opened format-switch

Download all attachments as: .zip

Change History (2)

Changed 3 years ago by Sönke Sprink

Attachment: editor-pm-frontend.png added

Screenshot opened format-switch

comment:1 Changed 3 years ago by Jakub Ś

Keywords: format config removed
Resolution: invalid
Status: newclosed
Version: 4.5.4

There are two mistakes here.

  1. Please have a look at https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/format/plugin.js#L59 and https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/format/plugin.js#L88 and https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/richcombo/plugin.js#L353.

    The reason why I'm showing you that code is because CKEditor by design, first displays value from language files and if it can't find such value there it uses value provided by the user. This is correct behaviour because of internationalization.
    You wanted to customize German labels but people of other nationalities and regional settings might also use your application and they should see languages according to their locale.

    Correct approach here is to modify language files - change the existing label to the one you want. You can do this in minified version or you can get source code, make changes and built your own release. Please see: http://docs.ckeditor.com/#!/guide/dev_source.

  1. Before you do any of the above please move these styled elements to Styles dropdown. The Format dropdown was created to hold raw HTML tags which change one formatting to another e.g. H3 to H1. When you style elements in format dropdown it's like having two style dropdowns. Such approach although possible is not recommended.

I'm sorry but this ticket is invalid.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy