Skip to content

Translations: incorrect domain using "t" function and named domain argument #44899

@noofaq

Description

@noofaq

Symfony version(s) affected

5.4.2

Description

Using Symfony\Component\Translation\t function and using named domain argument "translation:extract" and "debug:translations" use incorrect domain (default one messages is used).

How to reproduce

class DAMFileNameTemplate extends Constraint
{
    public function getMessage()
    {
        return t('error.dam_file_name_template_evaluation', domain: 'validators');
    }
}

Calling debug:translation reports incorrect domain:
obraz

Workaround:

class DAMFileNameTemplate extends Constraint
{
    public function getMessage()
    {
        return t('error.dam_file_name_template_evaluation', [], 'validators');
    }
}

Calling debug:translation reports correctly:
obraz

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy