Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 143b1fc

Browse files
author
Dmytro Vilchynskyi
committed
MAGETWO-84702: [SE Dev] Error Messages edits, part 1 (966 of 1166 total)
- several messages are updated
1 parent 4c4f79d commit 143b1fc

File tree

18 files changed

+57
-23
lines changed

18 files changed

+57
-23
lines changed

app/code/Magento/Analytics/Model/Config/Backend/CollectionTime.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public function afterSave()
6666
$result = preg_match('#(?<hour>\d{2}),(?<min>\d{2}),(?<sec>\d{2})#', $this->getValue(), $time);
6767

6868
if (!$result) {
69-
throw new LocalizedException(__('Time value has an unsupported format'));
69+
throw new LocalizedException(
70+
__('The time value is using an unsupported format. Enter a supported format and try again.')
71+
);
7072
}
7173

7274
$cronExprArray = [

app/code/Magento/Analytics/Model/Cryptographer.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,18 @@ public function encode($source)
5656
try {
5757
$source = (string)$source;
5858
} catch (\Exception $e) {
59-
throw new LocalizedException(__('Input data must be string or convertible into string.'));
59+
throw new LocalizedException(
60+
__(
61+
'The data is invalid. '
62+
. 'Enter the data as a string or data that can be converted into a string and try again.'
63+
)
64+
);
6065
}
6166
} elseif (!$source) {
62-
throw new LocalizedException(__('Input data must be non-empty string.'));
67+
throw new LocalizedException(__('The data is invalid. Enter the data as a string and try again.'));
6368
}
6469
if (!$this->validateCipherMethod($this->cipherMethod)) {
65-
throw new LocalizedException(__('Not valid cipher method.'));
70+
throw new LocalizedException(__('The data is invalid. Use a valid cipher method and try again.'));
6671
}
6772
$initializationVector = $this->getInitializationVector();
6873

@@ -90,7 +95,7 @@ private function getKey()
9095
{
9196
$token = $this->analyticsToken->getToken();
9297
if (!$token) {
93-
throw new LocalizedException(__('Encryption key can\'t be empty.'));
98+
throw new LocalizedException(__('Enter the encryption key and try again.'));
9499
}
95100
return hash('sha256', $token);
96101
}

app/code/Magento/Analytics/Model/ExportDataHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private function pack($source, $destination)
195195
private function validateSource(WriteInterface $directory, $path)
196196
{
197197
if (!$directory->isExist($path)) {
198-
throw new LocalizedException(__('Source "%1" is not exist', $directory->getAbsolutePath($path)));
198+
throw new LocalizedException(__('The "%1" source doesn\'t exist.', $directory->getAbsolutePath($path)));
199199
}
200200

201201
return $directory->getAbsolutePath($path);

app/code/Magento/Catalog/Model/Product/Option/Type/Date.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ public function validateUserValue($values)
123123
);
124124
} else {
125125
throw new \Magento\Framework\Exception\LocalizedException(
126-
__('Please specify product\'s required option(s).')
126+
__(
127+
"The product's required option(s) weren't entered. "
128+
. "Make sure the options are entered and try again."
129+
)
127130
);
128131
}
129132
} else {

app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ public function validateUserValue($values)
212212

213213
$option = $this->getOption();
214214
if (!isset($values[$option->getId()]) && $option->getIsRequire() && !$this->getSkipCheckRequiredOption()) {
215-
throw new LocalizedException(__('Please specify product\'s required option(s).'));
215+
throw new LocalizedException(
216+
__("The product's required option(s) weren't entered. Make sure the options are entered and try again.")
217+
);
216218
} elseif (isset($values[$option->getId()])) {
217219
$this->setUserValue($values[$option->getId()]);
218220
$this->setIsValid(true);

app/code/Magento/Catalog/Model/Product/Option/Type/File.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,12 @@ public function validateUserValue($values)
256256
} catch (ProductException $e) {
257257
switch ($this->getProcessMode()) {
258258
case \Magento\Catalog\Model\Product\Type\AbstractType::PROCESS_MODE_FULL:
259-
throw new LocalizedException(__('Please specify product\'s required option(s).'));
259+
throw new LocalizedException(
260+
__(
261+
"The product's required option(s) weren't entered. "
262+
. "Make sure the options are entered and try again."
263+
)
264+
);
260265
break;
261266
default:
262267
$this->setUserValue(null);

app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ public function validate($processingParams, $option)
216216
throw new LocalizedException(__(implode("\n", $errors)));
217217
}
218218
} else {
219-
throw new LocalizedException(__('Please specify product\'s required option(s).'));
219+
throw new LocalizedException(
220+
__("The product's required option(s) weren't entered. Make sure the options are entered and try again.")
221+
);
220222
}
221223
return $userValue;
222224
}

app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function validate($optionValue, $option)
102102
}
103103
} else {
104104
throw new \Magento\Framework\Exception\LocalizedException(
105-
__('Please specify product\'s required option(s).')
105+
__("The product's required option(s) weren't entered. Make sure the options are entered and try again.")
106106
);
107107
}
108108
return $result;

app/code/Magento/Catalog/Model/Product/Option/Type/Select.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,20 @@ public function validateUserValue($values)
6565

6666
if (empty($value) && $option->getIsRequire() && !$this->getSkipCheckRequiredOption()) {
6767
$this->setIsValid(false);
68-
throw new LocalizedException(__('Please specify product\'s required option(s).'));
68+
throw new LocalizedException(
69+
__("The product's required option(s) weren't entered. Make sure the options are entered and try again.")
70+
);
6971
}
7072
if (!$this->_isSingleSelection()) {
7173
$valuesCollection = $option->getOptionValuesByOptionId($value, $this->getProduct()->getStoreId())->load();
7274
if ($valuesCollection->count() != count($value)) {
7375
$this->setIsValid(false);
74-
throw new LocalizedException(__('Please specify product\'s required option(s).'));
76+
throw new LocalizedException(
77+
__(
78+
"The product's required option(s) weren't entered. "
79+
. "Make sure the options are entered and try again."
80+
)
81+
);
7582
}
7683
}
7784
return $this;

app/code/Magento/Catalog/Model/Product/Option/Type/Text.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ public function validateUserValue($values)
6161
// Check requires option to have some value
6262
if (strlen($value) == 0 && $option->getIsRequire() && !$this->getSkipCheckRequiredOption()) {
6363
$this->setIsValid(false);
64-
throw new LocalizedException(__('Please specify product\'s required option(s).'));
64+
throw new LocalizedException(
65+
__("The product's required option(s) weren't entered. Make sure the options are entered and try again.")
66+
);
6567
}
6668

6769
// Check maximal length limit

0 commit comments

Comments
 (0)