Haehnchen / idea-php-symfony2-plugin

IntelliJ IDEA / PhpStorm Symfony Plugin
https://plugins.jetbrains.com/plugin/7219
MIT License
913 stars 137 forks source link

[Twig] Generator for trans #506

Open rvanlaak opened 9 years ago

rvanlaak commented 9 years ago

While adding translations in my templates, it would be great if that could speed up by generating the stub code for a translation. Currently no generators are there, except the XML tag while pressing ALT + Insert.

twig-trans

Would be great a stub for a Twig translation filter could be added from that menu. Especially because the filter has to be added after the quote characters, so now that takes lot of presses on the arrow keys.

rvanlaak commented 9 years ago

@Haehnchen what do you think about adding extra stubs speed up things?

Now ALT + ins only shows "Generate > XML tag", but it could always result in generators for the following tags and place the cursor at the place of the ‡ sign.

{% ‡ %}
{{ ‡ }}
{{ '‡' }}
{{ '‡'|trans }}

We could also think of other tags where the filter is located after quotes, and require intensive navigating with the keyboard arrows.

Haehnchen commented 9 years ago

it only make sense with a dialog to select a translation and the "trans style" to insert. all other are more like "code templates"

rvanlaak commented 9 years ago

Would the plugin be able to add code templates then?

Haehnchen commented 7 years ago

poc is ready, sweet stuff ;) same logic as translation extraction to detection domains and provide a preselected list