Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
change validation texts
Browse files Browse the repository at this point in the history
  • Loading branch information
rratsun committed Jan 22, 2021
1 parent bda478d commit bdb5153
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/Core/Validation/Items/ColorDepth.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ public function validate(): bool
*/
public function onValidateFail()
{
throw new BadRequest(sprintf($this->exception('Color depth must be in the list %s'), implode(", ", $this->params)));
throw new BadRequest(sprintf($this->exception('colorDepthValidationFailed'), implode(", ", $this->params)));
}
}
2 changes: 1 addition & 1 deletion app/Core/Validation/Items/ColorSpace.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function validate(): bool
*/
public function onValidateFail()
{
throw new BadRequest(sprintf($this->exception('Color space must be in the list %s'), implode(", ", $this->params)));
throw new BadRequest(sprintf($this->exception('colorSpaceValidationFailed'), implode(", ", $this->params)));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Core/Validation/Items/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ public function validate(): bool
*/
public function onValidateFail()
{
throw new BadRequest(sprintf($this->exception('Use only files with next extensions: %s'), implode(", ", $this->params)));
throw new BadRequest(sprintf($this->exception('fileExtensionValidationFailed'), implode(", ", $this->params)));
}
}
2 changes: 1 addition & 1 deletion app/Core/Validation/Items/Mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public function validate(): bool
*/
public function onValidateFail()
{
throw new BadRequest($this->exception('Asset has incorrect MIME type'));
throw new BadRequest($this->exception('mimeTypeValidationFailed'));
}
}
2 changes: 1 addition & 1 deletion app/Core/Validation/Items/PdfValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ public function validate(): bool
*/
public function onValidateFail()
{
throw new BadRequest($this->exception('Asset is not a PDF document'));
throw new BadRequest($this->exception('pdfValidationFailed'));
}
}
2 changes: 1 addition & 1 deletion app/Core/Validation/Items/Quality.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ public function validate(): bool
*/
public function onValidateFail()
{
throw new BadRequest(sprintf($this->exception('Image quality must be between %s and %s'), $this->params['min'], $this->params['max']));
throw new BadRequest(sprintf($this->exception('imageQualityValidationFailed'), $this->params['min'], $this->params['max']));
}
}
2 changes: 1 addition & 1 deletion app/Core/Validation/Items/Ratio.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public function validate(): bool
*/
public function onValidateFail()
{
throw new BadRequest(sprintf($this->exception('Image must have side ratio of %s'), $this->params));
throw new BadRequest(sprintf($this->exception('imageRatioValidationFailed'), $this->params));
}
}
2 changes: 1 addition & 1 deletion app/Core/Validation/Items/Scale.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function validate(): bool
public function onValidateFail()
{
throw new BadRequest(
sprintf($this->exception('Image must have width more than %spx and height more than %spx'), $this->params['min']['width'], $this->params['min']['height'])
sprintf($this->exception('imageScaleValidationFailed'), $this->params['min']['width'], $this->params['min']['height'])
);
}
}
2 changes: 1 addition & 1 deletion app/Core/Validation/Items/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ public function validate(): bool
*/
public function onValidateFail()
{
throw new BadRequest(sprintf($this->exception('Asset size should be between %skb and %skb'), $this->params['min'], $this->params['max']));
throw new BadRequest(sprintf($this->exception('imageSizeValidationFailed'), $this->params['min'], $this->params['max']));
}
}
18 changes: 9 additions & 9 deletions app/Resources/i18n/de_DE/Global.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"validationRules": "Validierungsregel"
},
"exceptions": {
"Color depth must be in the list %s": "Farbtiefe sollte in der Liste %s sein.",
"Color space must be in the list %s": "Farbraum sollte in der Liste %s sein.",
"Use only files with next extensions: %s": "Nutzen Sie die Dateien nur mit folgenden Erweiterungen: %s.",
"Asset has incorrect MIME type": "Asset hat einen falschen MIME-Typ.",
"Asset is not a PDF document": "Asset ist kein PDF-Dokument.",
"Image quality must be between %s and %s": "Bildqualität sollte zwischen %s und %s sein.",
"Image must have side ratio of %s": "Bild sollte ein Seitenverhältnis von %s haben.",
"Image must have width more than %spx and height more than %spx": "Bild sollte eine Breite mehr als %spx und eine Höhe mehr als %spx haben.",
"Asset size should be between %skb and %skb": "Asset-Größe sollte zwischen %skb und %skb sein."
"colorDepthValidationFailed": "Die Farbtiefe dieses Assets ist nicht zulässig.",
"colorSpaceValidationFailed": "Der Farbraum dieses Assets ist nicht zulässig.",
"fileExtensionValidationFailed": "Nutzen Sie die Dateien nur mit folgenden Erweiterungen: %s.",
"mimeTypeValidationFailed": "Asset hat einen falschen MIME-Typ.",
"pdfValidationFailed": "Asset ist kein PDF-Dokument.",
"imageQualityValidationFailed": "Bildqualität sollte zwischen %s und %s sein.",
"imageRatioValidationFailed": "Bild sollte ein Seitenverhältnis von %s haben.",
"imageScaleValidationFailed": "Bild sollte eine Breite mehr als %spx und eine Höhe mehr als %spx haben.",
"imageSizeValidationFailed": "Asset-Größe sollte zwischen %skb und %skb sein."
},
"labels": {
"Preview": "Vorschau",
Expand Down
18 changes: 9 additions & 9 deletions app/Resources/i18n/en_US/Global.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"validationRules": "Validation Rules"
},
"exceptions": {
"Color depth must be in the list %s": "Color depth must be in the list %s.",
"Color space must be in the list %s": "Color space must be in the list %s.",
"Use only files with next extensions: %s": "Use only files with next extensions: %s.",
"Asset has incorrect MIME type": "Asset has incorrect MIME type.",
"Asset is not a PDF document": "Asset is not a PDF document.",
"Image quality must be between %s and %s": "Image quality must be between %s and %s.",
"Image must have side ratio of %s": "Image must have side ratio of %s.",
"Image must have width more than %spx and height more than %spx": "Image must have width more than %spx and height more than %spx.",
"Asset size should be between %skb and %skb": "Asset size should be between %skb and %skb."
"colorDepthValidationFailed": "Color depth of this asset is not allowed.",
"colorSpaceValidationFailed": "Color space of this asset is not allowed.",
"fileExtensionValidationFailed": "Use only files with next extensions: %s.",
"mimeTypeValidationFailed": "Asset has incorrect MIME type.",
"pdfValidationFailed": "Asset is not a PDF document.",
"imageQualityValidationFailed": "Image quality must be between %s and %s.",
"imageRatioValidationFailed": "Image must have side ratio of %s.",
"imageScaleValidationFailed": "Image must have width more than %spx and height more than %spx.",
"imageSizeValidationFailed": "Asset size should be between %skb and %skb."
}
}

0 comments on commit bdb5153

Please sign in to comment.