Skip to content

Twig "trans" filter with "trans_default_domain" does not work correctly #476

@kherge

Description

@kherge

First off, this plugin is a godsend so thanks for all the work put into this!

Unfortunately, it appears that the plugin does not change the domain for the trans filter if I use trans_default_domain in my Twig template.

{% trans_default_domain "hello_world" -%}

<html>
  <head>
    <title>{{ 'page.title'|trans }}</title>
  </head>
  <body>
    <p>{{ 'page.content'|trans }}</p>
  </body>
</html>

The actual code works fine when I run it, but PhpStorm reports that the translations are missing. It may also be important to note that I may use the - character to trim whitespace on either side of trans_default_domain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions