Skip to content

Provide alternative way to set domain for translations #4944

Closed
@Koc

Description

@Koc

When bundles has personal translation domains it is too hard to set domain in controllers/templates. For example now we have

{{ 'registration.greeting_message'|trans({}, 'VendorNameBundle') }}
<?php

$this->translator->trans('registration.greeting_message', array(), 'VendorNameBundle');

I am proposing provide alternative way to set domain, like

{{ 'VendorNameBundle@registration.greeting_message'|trans }}
<?php

$this->translator->trans('VendorNameBundle@registration.greeting_message');

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