Problem/Motivation

The configuration is not translatable as there is no config schema.

Steps to reproduce

Try to translate the block and see there is no label or views_label to translate.

Proposed resolution

Provide a correct config schema.

Remaining tasks

Review patch.

User interface changes

-

API changes

-

Data model changes

-

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

tim-diels created an issue. See original summary.

tim-diels’s picture

Assigned: tim-diels » Unassigned
Status: Active » Needs review

Provided default schema to make labels translatable. A follow up issue can be added to provide a correct schema for all settings.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

While this is correct, and it does make the configuration translatable, it is only because the views_block config schema is configured like this:

views_block:
  type: block_settings
  label: 'View block'
  mapping:
    views_label:
      type: label
      label: 'Title'
    items_per_page:
      type: string
      label: 'Items per block'

Actually, because of all the core config schema validation stuff that his happening lately this is a good way to do it, because it will automatically get all the improvements from core.
I started out this comment by wanting to have this explicitly configured here, but I think the solution by @tim-diels actually makes a lot of sense, because it builds on existing schema configuration.

Looks good to me.

Mecmecker’s picture

Tested and works for me on Drupal 10 php version 8.1.12

carlosmonroy’s picture

I have tested the changes and it works fine

joanpebupe’s picture

What provided by @tim-diels in #3 looks good to me as well.

guillemsm’s picture

The schema for the module is working and making it translatable in Drupal version 10.1.7 and PHP v8.1.26

antoniodp’s picture

For mi works well #3 with drupal 10.1.5 and PHP 8.1.20.
Thanks

bernat martí pareja’s picture

The fork provided by Tim makes the block translatable.

manuel.adan made their first commit to this issue’s fork.

manuel.adan’s picture

Status: Reviewed & tested by the community » Needs review

I added the full schema on top of the existing changes, keeping the idea of extending core views block schema.

tim-diels’s picture

Actually there was a follow up issue #3358436: Provide full schema to build further on this.

guillemsm’s picture

Status: Needs review » Reviewed & tested by the community

The completed schema has been checked and seems to work.

Using the config_inspector module there was 6 errors before applying the patch and after applying the new schema the config_inspector report indicates that everything is fine.

manuel.adan’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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