Updated: Comment #N

Problem/Motivation

#2160365: Date field required marker rendered as "Array" brought up that it's pretty easy to end up with "Array" on the page when using trans tags. We should at least make this more obvious. Trans tags are by design only meant to deal with simple variables, mostly strings.

Proposed resolution

Expand the exception handling in the trans token parser to throw an exception for arrays/render arrays. See \Drupal\Core\Template\TwigTransTokenParser::checkTransString() for the existing error handling.

Remaining tasks

  • Patch
  • Tests
  • Patch review

User interface changes

n/a

API changes

Not really an API change, just a DX improvement.

Comments

star-szr’s picture

Issue summary: View changes

Expand problem/motivation slightly and link to change record for trans tags.

lauriii’s picture