Skip to content

Commit

Permalink
Merge pull request Sylius#6927 from NeverResponse/validation/regexp-c…
Browse files Browse the repository at this point in the history
…odes

Regex validation for codes
  • Loading branch information
pjedrzejewski authored Nov 29, 2016
2 parents de49467 + 0cc18a3 commit 8bd68a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Resources/config/validation/Locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
<option name="message">sylius.locale.code.not_blank</option>
<option name="groups">sylius</option>
</constraint>
<constraint name="Regex">
<option name="message">sylius.locale.code.regex</option>
<option name="pattern">/^[\w-]*$/</option>
<option name="groups">sylius</option>
</constraint>
</property>
</class>
</constraint-mapping>
1 change: 1 addition & 0 deletions Resources/translations/validators.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ sylius:
locale:
code:
not_blank: Please choose locale code.
regex: Locale code can only be comprised of letters, numbers, dashes and underscores.
unique: Locale code must be unique.

0 comments on commit 8bd68a6

Please sign in to comment.