wearewondrous / fractal-twig-drupal-adapter

Twig template adapter for Fractal with Drupal 8 directives.
http://fractal.build
MIT License
13 stars 13 forks source link

Plural support for 'trans' tag #3

Closed juliquiron closed 5 years ago

juliquiron commented 7 years ago

Hi!

I'm working on implementing the plural tag support in the trans statment which is implemented in src/tags/index.js.

The plural works like an !== 1 comparison. The difference is that isn't set in the open tag. Is set inside the trans block with the {% plural var_name %} tag. So it works like an if but requires a kind of precompilation to check the condition inside the block.

Anyone can help me with some indication of how to approach to this 'precompilation'??

Thanks.

yobottehg commented 7 years ago

don't you think that this is something that belongs more into the Drupal side of templates and rendering and not directly into the component?

Just want to get your usecase because the Styleguide itself should not care about the string and just output it.