symfony how to use custom validators.yml file under MyBundle\Resources\translations

nyluje

On symfony3, I implement a custom form (no FosUserBundle is used on purpose because I go PDO instead of ORM to manage my DB).

On that form I want error message to be displayed.

It does work but use the default "translators.[lang].xlf" file which is under the folder: [MyProject]\vendor\symfony\symfony\src\Symfony\Component\Validator\Resources\translations.

I added a "validators.[lang].yml" file under the directory: [MyProject]\src\[MyBundle]\Resources\translations: It doesn't work. I have some "messages.[lang].yml" files under that same directory and those work.

So I guess that I am missing something to have the "validators.[lang].yml" under "MyBundle" being recognized.

I see that in the symfony translation cookbook describes a way to add some extra catalog, but I don't get where it is supposed to be done -which file under which symfony folder?

I would have thought that this could have been automated as soon as a validators.[lang].yml file had been placed under the directory [MyProject]\src[MyBundle]\Resources\translations, or a setting to do in the config.yml.

Does anyone have an experience to share about that?

nyluje

My bad...

After I had added "validators.[lang].yml" file under the directory: [MyProject]\src[MyBundle]\Resources\translations.

I should have done a "[MyProject]\ php bin/console cache:clear".

It is explained here: http://symfony.com/doc/current/book/translation.html#book-translation-resource-locations

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can i send parameters to validators.lang.yml in symfony2 validator engine?

From Dev

What's the use of parameters.yml file in Symfony

From Dev

How to tell symfony to load my custom routing.yml configuration

From Dev

How to use Property placeholders in .yml file

From Dev

How to use custom validators of github.com/1000hz/bootstrap-validator

From Dev

How to use a custom ValidatorUpdateDisplay function when the controls / validators are loaded on postback in an UpdatePanel the first time?

From Dev

Do you have to register your custom validators in symfony

From Dev

(Laravel) How to add errors in custom validators?

From Dev

Rails use of yml file

From Dev

Symfony EntityType - How to use custom layout?

From Dev

Possible to modify / write to a custom parameters.yml file in symfony2?

From Dev

How to use validators in InputFilter on array from post?

From Dev

How to use global variable in symfony twig file?

From Dev

How to "require" a .yml file?

From Dev

Passing constructor arguments in routing yml file in Symfony

From Dev

Spring MockMVC - How to mock custom validators running outside of controllers

From Dev

How do I add custom validators in JOI 17?

From Dev

Spring MockMVC - How to mock custom validators running outside of controllers

From Dev

Symfony2: How to use constraints on custom compound form type?

From Dev

How to create and use a form in a custom class in Symfony 2

From Dev

How to use my custom Symfony 3.0 Library/Bundle/HowIsCalled

From Dev

Symfony2: How to use constraints on custom compound form type?

From Dev

Testing custom validators with Minitest

From Dev

CausesValidation not working with custom validators

From Dev

Spring MVC custom validators

From Dev

Django Custom Validators Not Working

From Dev

Proptypes custom validators with Flow

From Dev

How to add custom property to Symfony Doctrine YAML mapping file

From Dev

Creating custom YML file in minecraft plugin

Related Related

  1. 1

    How can i send parameters to validators.lang.yml in symfony2 validator engine?

  2. 2

    What's the use of parameters.yml file in Symfony

  3. 3

    How to tell symfony to load my custom routing.yml configuration

  4. 4

    How to use Property placeholders in .yml file

  5. 5

    How to use custom validators of github.com/1000hz/bootstrap-validator

  6. 6

    How to use a custom ValidatorUpdateDisplay function when the controls / validators are loaded on postback in an UpdatePanel the first time?

  7. 7

    Do you have to register your custom validators in symfony

  8. 8

    (Laravel) How to add errors in custom validators?

  9. 9

    Rails use of yml file

  10. 10

    Symfony EntityType - How to use custom layout?

  11. 11

    Possible to modify / write to a custom parameters.yml file in symfony2?

  12. 12

    How to use validators in InputFilter on array from post?

  13. 13

    How to use global variable in symfony twig file?

  14. 14

    How to "require" a .yml file?

  15. 15

    Passing constructor arguments in routing yml file in Symfony

  16. 16

    Spring MockMVC - How to mock custom validators running outside of controllers

  17. 17

    How do I add custom validators in JOI 17?

  18. 18

    Spring MockMVC - How to mock custom validators running outside of controllers

  19. 19

    Symfony2: How to use constraints on custom compound form type?

  20. 20

    How to create and use a form in a custom class in Symfony 2

  21. 21

    How to use my custom Symfony 3.0 Library/Bundle/HowIsCalled

  22. 22

    Symfony2: How to use constraints on custom compound form type?

  23. 23

    Testing custom validators with Minitest

  24. 24

    CausesValidation not working with custom validators

  25. 25

    Spring MVC custom validators

  26. 26

    Django Custom Validators Not Working

  27. 27

    Proptypes custom validators with Flow

  28. 28

    How to add custom property to Symfony Doctrine YAML mapping file

  29. 29

    Creating custom YML file in minecraft plugin

HotTag

Archive