Skip to content

Commit

Permalink
Standardize locale validation translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojdylak committed Nov 8, 2023
1 parent a27f5c2 commit aceb04b
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ sylius:
max_length: Attribute presentation must not be longer than 1 character.|Attribute presentation must not be longer than {{ limit }} characters.
type:
unregistered: The attribute type "%type%" is not registered.
locale:
not_blank: Please enter the locale.
attribute_value:
attribute:
not_blank: Please select attribute.
value:
not_blank: Please enter attribute value.
translation:
locale:
not_blank: Please enter the locale.
invalid: This value is not a valid locale.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.association_type.locale.not_blank</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.option.locale.not_blank</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.option_value.locale.not_blank</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.product.locale.not_blank</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.product_variant.locale.not_blank</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@ sylius:
max_length: Product meta keywords must not be longer than 1 character.|Product meta keywords must not be longer than {{ limit }} characters.
meta_description:
max_length: Product meta description must not be longer than 1 character.|Product meta description must not be longer than {{ limit }} characters.
locale:
not_blank: Please enter the locale.
product_variant:
combination: Variant with this option set already exists.
code:
not_blank: Please enter the code.
regex: Product variant code can only be comprised of letters, numbers, dashes and underscores.
unique: Product variant code must be unique.
within_product_unique: This code must be unique within this product.
locale:
not_blank: Please enter the locale.
simple_product:
code:
unique: Simple product code must be unique among all products and product variants.
Expand All @@ -44,17 +40,13 @@ sylius:
max_length: Option name must not be longer than 1 character.|Option name must not be longer than {{ limit }} characters.
values:
min_count: Please add at least {{ limit }} option value.|Please add at least {{ limit }} option values.
locale:
not_blank: Please enter the locale.
option_value:
code:
not_blank: Please enter option value code.
regex: Option value code can only be comprised of letters, numbers, dashes and underscores.
unique: The option value with given code already exists.
value:
not_blank: Please enter option value.
locale:
not_blank: Please enter the locale.
association_type:
name:
not_blank: Please enter association type name.
Expand All @@ -64,5 +56,7 @@ sylius:
not_blank: Please enter association type code.
regex: Association type code can only be comprised of letters, numbers, dashes and underscores.
unique: The association type with given code already exists.
translation:
locale:
not_blank: Please enter the locale.
invalid: This value is not a valid locale.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.catalog_promotion.locale.not_blank</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.promotion.locale.not_blank</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ sylius:
not_blank: Please enter catalog promotion name.
state:
processing: The catalog promotion cannot be edited as it is currently being processed.
locale:
not_blank: Please enter the locale.
catalog_promotion_action:
invalid_type: Catalog promotion action type is invalid. Please choose a valid type.
percentage_discount:
Expand All @@ -38,8 +36,6 @@ sylius:
max_length: Promotion name must not be longer than 1 character.|Promotion name must not be longer than {{ limit }} characters.
min_length: Promotion name must be at least 1 character long.|Promotion name must be at least {{ limit }} characters long.
not_blank: Please enter promotion name.
locale:
not_blank: Please enter the locale.
promotion_action:
percentage_discount_configuration:
not_in_range: The percentage discount must be between 0% and 100%.
Expand All @@ -65,3 +61,7 @@ sylius:
possible_generation_amount: Invalid coupons code length or coupons amount. It is not possible to generate %expectedAmount% unique coupons with code length %codeLength%. The possible amount to generate is %possibleAmount%.
usage_limit:
min: Usage limit of generated coupons must be at least {{ limit }}.
translation:
locale:
not_blank: Please enter the locale.
invalid: This value is not a valid locale.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.shipping_method.locale.not_blank</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ sylius:
unique: 'The shipping method with given code already exists.'
zone:
not_blank: 'Please select shipping method zone.'
locale:
not_blank: 'Please enter the locale.'

shipment:
shipping_method:
not_blank: 'Please select shipping method.'
translation:
locale:
not_blank: 'Please enter the locale.'
invalid: 'This value is not a valid locale.'
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.taxon.locale.not_blank</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ sylius:
slug:
not_blank: Please enter taxon slug.
unique: Taxon slug must be unique.
locale:
not_blank: Please enter the locale.
taxonomy:
name:
max_length: Taxonomy name must not be longer than 255 characters.
not_blank: Please enter taxonomy name.
translation:
locale:
not_blank: Please enter the locale.
invalid: This value is not a valid locale.

0 comments on commit aceb04b

Please sign in to comment.