4

I'm using the Easy Admin bundle to manage the back-end of my Symfony application.

I'd like to translate the following message "max 200 characters"

There are several properties that needs this kind of message so I'd like to make it more flexible using a variable as in Twig:

{{ 'max.character'|trans({'%max%': 200}) }}

and my message.yaml would be:

max:
    character: 'max %max% characters'

According to the bundle documentation there is nothing about variable.

So is it possible and if yes how can I use variable in this kind of way:

edit:
    fields:
        - {property: 'toto', label: 'toto.label', help: 'max.character' {%max%:200} }
yivi
  • 42,438
  • 18
  • 116
  • 138
Pierrick Rambaud
  • 1,726
  • 1
  • 20
  • 47
  • Can't understand the question. Can you clarify? You want to know how to access the `max.character` setting in your Twig file to pass it to the `trans` filter? Or what? Can you add more details? – yivi Dec 17 '19 at 08:47
  • I want to use translation parameters in the yaml easy-admin config file. The documentation doesn't explain if it's possible. I just gave a regular twig example to show which kind of variable I want to add. – Pierrick Rambaud Dec 17 '19 at 09:00

0 Answers0