Problem/Motivation

The type of views_field.mapping.alter.mapping.text is text and text is translatable. The value is a Twig inline template and is passed to Twig engine, see PluginBase::viewsTokenReplace(). But Twig has its own way to translate strings inside a template by using the t/trans filter and such a template should not be translatable.

If the view was shipped as module config, Locale will expose it in the translation UI. Other modules will send such strings to automated translation and would break the view on other languages.

Steps to reproduce

See the MR's test.

Proposed resolution

Set the schema from text to string

Remaining tasks

Decide how to handle the potential BC break: e.g., existing views set static text there, expecting to be translated

User interface changes

Introduced terminology

N/A

API changes

None.

Data model changes

Release notes snippet

Issue fork drupal-3637680

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

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

I've added a test to prove the issue.

claudiu.cristea’s picture

Status: Active » Needs review
Related issues: +#3008138: The link url in views must be translatable

For now, 'path' is excluded because of #3008138: The link url in views must be translatable. We may want a followup for path

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs release note, +Needs change record

We discussed this issue in slack too. Looks good to me.

I think this needs a change record and release notes. Not much else we can do about it IMHO.