• does not include .twig extension
  • does not have patterns for 't' and 'trans' use cases

Comments

SKAUGHT created an issue. See original summary.

skaught’s picture

skaught’s picture

Status: Active » Needs review
chili.hh’s picture

Status: Needs review » Needs work

Hi SKAUGHT,

I tried your patch, but your regex does not seem to capture reliably. For example, I couldn't get it to work on the module votingapi_widgets, which contains {{ trans }} tags in twig files like below:

{{ trans }}
  {{ results.vote_field_count }} Votes2 with an average with {{ results.vote_field_average }}
{{ endtrans }}

Could you review your regex please? I'll be happy to include it in the module default config.

skaught’s picture

i see. twig has a wide range of possible use-cases -- is part of the problem.. off hand, i'm not sure how to cover this in one condition. maybe a second (or more) entry would be good to use.

skaught’s picture

StatusFileSize
new1013 bytes

roll into 1.3

ccrosaz’s picture

Hello @SKAUGHT,

I just apply your patch by hand locally on my own config, on a version 8.x-1.3, and it works like a charm.

Thanks for this solution saving my time on extracting twig translation strings (simple |t).