Skip to content

[Twig] Generator for trans #506

@rvanlaak

Description

@rvanlaak

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.

Activity

rvanlaak

rvanlaak commented on Jun 19, 2015

@rvanlaak
Author

@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.

changed the title [-]Twig generator for trans[/-] [+][Twig] Generator for trans[/+] on Jun 28, 2015
Haehnchen

Haehnchen commented on Jun 28, 2015

@Haehnchen
Owner

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

rvanlaak commented on Jun 28, 2015

@rvanlaak
Author

Would the plugin be able to add code templates then?

Haehnchen

Haehnchen commented on Sep 19, 2017

@Haehnchen
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Haehnchen@rvanlaak

        Issue actions

          [Twig] Generator for trans · Issue #506 · Haehnchen/idea-php-symfony2-plugin