Problem/Motivation

Steps to reproduce:

  1. Make sure you have schema_article_type set to "Article"
  2. Reinstall your site with a locale different than English (e.g. German)
  3. Assert that schema_article_type has translated value i.e. "Artikel"

This happens due to metatag.metatag_tag.schema_article_type having text as a type value. That tells Drupal this is a translatable string and by default Drupal imports config translations as soon as you add a new language.

In my opinion schema_article_type/@type is not something that is different per translation.

Proposed resolution

Change the metatag.metatag_tag.schema_article_type type to string in order to make this key untransltable.

Check for the other similar cases.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3107764-2.patch11.41 KBmbovan

Comments

mbovan created an issue. See original summary.

mbovan’s picture

Status: Active » Needs review
StatusFileSize
new11.41 KB

This fixes the issue for all schema_*_type keys.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

I think there are more config schema strings that can be moved, most should be label and not text, as they don't need to multi-label elements, and others might also not need to be translated, like the published date (that needs to be a defined format, not something that varies between languages).

But this is the most obvious one and causes invalid metadata due to the default translation.

  • KarenS committed ee6928c on 8.x-1.x authored by mbovan
    Issue #3107764 by mbovan, Berdir: Schema type "@type" should not be...
karens’s picture

Status: Reviewed & tested by the community » Fixed

This is due to my confusion about the difference between string and text. Thanks!

Status: Fixed » Closed (fixed)

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