Problem/Motivation

On multilingual sites, you can't translate the top_label field of the configuration stored within a toc_filter config entity.

Steps to reproduce

  • Install Drupal core, 10.4 || 11.x (its not specific to a particular version, these are the two I tested with)
  • Enable toc_api_example and config_translation, eg. ddev drush en -y config_translation toc_api_example
  • Add an additional language (/admin/config/regional/language/add)
  • Create some content with some <h2>'s in the body field
  • View the content in the alternate language
  • At this point, we expect that the "Back to top" links will be in the default English and not translated. Lets go translate them!
  • Go to Structure > Table of contents types. Click Translate from the Operations column next to Default
  • Click Edit/Add from the Operations column for the language added in the previous step

Expected result

The "Back to top" (top_label) option should be available to translate.

Actual result

You can't translate the "Back to top" (top_label) option. You're stuck with "Back to top" in all languages.

Proposed resolution

The config schema declares this setting as a type string. It should be type label so that it can be translated into other languages using config_translation module.

Remaining tasks

MR

Issue fork toc_api-3521083

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

m4olivei created an issue. See original summary.

m4olivei’s picture

Issue summary: View changes

m4olivei’s picture

Status: Active » Needs review

Simple fix. MR is up. Ready for review!

m4olivei’s picture

Title: Unable to use config_translation to translate most toc_type entities » Unable to use config_translation to translate top_label toc_type entity field
Issue summary: View changes
m4olivei’s picture

Issue summary: View changes
m4olivei’s picture

Issue summary: View changes
joseph.olstad’s picture

Status: Needs review » Fixed

joseph.olstad’s picture

adding credit

joseph.olstad’s picture

Status: Fixed » Closed (fixed)

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

joseph.olstad’s picture

Please upgrade to 2.0.1-rc1 and let me know how it works out for you. I won't tag 2.0.1 until I get at least some statistics on usage or some kind of feedback.