Problem/Motivation

At the moment the schema definition for the list of styles in ckeditor doesn't support translation.

# Plugin \Drupal\ckeditor\Plugin\ckeditor\plugin\StylesCombo
ckeditor.plugin.stylescombo:
  type: mapping
  label: 'Styles dropdown'
  mapping:
    styles:
      type: string
      label: 'List of styles'
      translatable: true

Proposed resolution

As this string contains labels we should enable translation.

settings:
  plugins:
    stylescombo:
      styles: "table.mytableclass|Label to translate for my table class"
CommentFileSizeAuthor
#2 3063020_2.patch457 bytesmpp

Comments

mpp created an issue. See original summary.

mpp’s picture

Assigned: mpp » Unassigned
Status: Active » Needs review
StatusFileSize
new457 bytes
mpp’s picture

Issue summary: View changes
ducktape’s picture

Status: Needs review » Reviewed & tested by the community

Nice catch @mpp. Looks good.

wim leers’s picture

Title: Support translation for the list of styles in ckeditor » Support translation of the list of styles in CKEditor
Issue tags: +D8MI, +Configuration schema

As this string contains labels we should enable translation.

+++ b/core/modules/ckeditor/config/schema/ckeditor.schema.yml
@@ -48,5 +48,5 @@ ckeditor.plugin.stylescombo:
-      type: string
+      type: label

TIL! 🙏 👏

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 84df3bb and pushed to 8.8.x. Thanks! Also cherry-picked to 8.7.x

  • catch committed 84df3bb on 8.8.x
    Issue #3063020 by mpp: Support translation of the list of styles in...

  • catch committed 19ef2a1 on 8.7.x
    Issue #3063020 by mpp: Support translation of the list of styles in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

berdir’s picture

See #2571371: Editor settings cannot be translated, which was an existing, older issue. I don't think this is sufficient to resolve this, we also need to actually allow translation if it in the UI and editors are a bit special case as they don't have dedicated routes.

berdir’s picture

Also, as done over there, type label is also wrong IMHO because that's a single textfield, type text is a translatable textarea.