Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract validators messages while using All Constraint @Assert\All #450

Open
plPubel opened this issue Jul 12, 2017 · 0 comments
Open

Extract validators messages while using All Constraint @Assert\All #450

plPubel opened this issue Jul 12, 2017 · 0 comments

Comments

@plPubel
Copy link

plPubel commented Jul 12, 2017

Q A
Bundle version 1.1.0-DEV
Symfony version 3.3.2
PHP version 7.0

While using All Constraint source
validation messages aren't extracted.

Expected behavior

<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
  <file date="2017-07-12T11:23:29Z" source-language="en" target-language="en" datatype="plaintext" original="not.available">
    <header>
      <tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
      <note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
    </header>
    <body>
    <trans-unit id="93241dfaa3aa151ae7e5ddc052bab7c9178c2a6c" resname="acme.maxSize {{ limit }} {{ suffix }}">
        <source>acme.maxSize</source>
        <target>File is too large. Max size {{ limit }} {{ suffix }}</target>
        <jms:reference-file line="22">...</jms:reference-file>
    </trans-unit>
    <trans-unit id="308ce36466512c0148bdcda1182091de0824e6c7" resname="acme.typeMessage">
        <source>acme.typeMessage</source>
        <target>Unsupported file extension</target>
        <jms:reference-file line="24">...</jms:reference-file>
    </trans-unit>
    <trans-unit id="edebf69a6416d3d607860ed7ff112b8e8f955d9b" resname="acme.fileBlank">
        <source>acme.fileBlank</source>
        <target>It looks that file is empty</target>
        <jms:reference-file line="22">...</jms:reference-file>
    </trans-unit>
    </body>
  </file>
</xliff>

Actual behavior

No output

Steps to reproduce

Example annotation

/**
* @ORM\Column(type="array")
* @Assert\All({
*     @Assert\NotBlank(
*         message="acme.fileBlank"
*     ),
*     @Assert\File(
*         maxSize = "5M",
*         maxSizeMessage = "acme.maxSize {{ limit }} {{ suffix }}",
*         mimeTypes = { "image/jpeg", "application/pdf" },
*         mimeTypesMessage = "acme.typeMessage"
*     ),
* })
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant