Skip to content

Commit 87c2bcc

Browse files
committed
Fixed validator error messages
1 parent 7ebcc23 commit 87c2bcc

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

resources/magento2/validation.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
validator.notEmpty=The {0} field must not be empty
22
validator.package.validPath=Please specify a valid Magento 2 installation path
3-
validator.alphaNumericCharacters={0} must contain letters and numbers only
3+
validator.alphaNumericCharacters=The {0} must contain letters and numbers only
44
validator.alphaNumericAndUnderscoreCharacters={0} must contain letters, numbers and underscores only
55
validator.alreadyDeclared={0} is already declared in the {1} module.
6-
validator.startWithNumberOrCapitalLetter={0} must start from a number or a capital letter
6+
validator.startWithNumberOrCapitalLetter=The {0} must start from a number or a capital letter
77
validator.onlyNumbers={0} must contain numbers only
88
validator.mustNotBeNegative={0} must not be negative
99
validator.identifier={0} must contain letters, numbers, dashes, and underscores only
10-
validator.class.isNotValid={0} is not valid class name
10+
validator.class.isNotValid=The {0} is not valid class name
1111
validator.class.shouldBeUnique=Duplicated class {0}
12-
validator.namespace.isNotValid={0} is not valid namespace name
12+
validator.namespace.isNotValid=The {0} is not valid namespace name
1313
validator.directory.isNotValid={0} is not valid
1414
validator.module.noSuchModule=No such module {0}
1515
validator.file.alreadyExists={0} already exists

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewControllerDialog.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
import com.magento.idea.magento2plugin.actions.generation.data.ControllerFileData;
1313
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.annotation.FieldValidation;
1414
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.annotation.RuleRegistry;
15+
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.AlphanumericRule;
1516
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.NotEmptyRule;
17+
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.PhpClassRule;
18+
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.PhpNamespaceNameRule;
19+
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.StartWithNumberOrCapitalLetterRule;
1620
import com.magento.idea.magento2plugin.actions.generation.generator.ModuleControllerClassGenerator;
1721
import com.magento.idea.magento2plugin.magento.files.ControllerBackendPhp;
1822
import com.magento.idea.magento2plugin.magento.files.ControllerFrontendPhp;
@@ -59,18 +63,18 @@ public class NewControllerDialog extends AbstractDialog {
5963

6064
@FieldValidation(rule = RuleRegistry.NOT_EMPTY,
6165
message = {NotEmptyRule.MESSAGE, CONTROLLER_NAME})
62-
@FieldValidation(rule = RuleRegistry.START_WITH_NUMBER_OR_CAPITAL_LETTER,
63-
message = {NotEmptyRule.MESSAGE, CONTROLLER_NAME})
64-
@FieldValidation(rule = RuleRegistry.ALPHANUMERIC,
65-
message = {NotEmptyRule.MESSAGE, CONTROLLER_NAME})
66-
@FieldValidation(rule = RuleRegistry.PHP_CLASS,
67-
message = {NotEmptyRule.MESSAGE, CONTROLLER_NAME})
66+
@FieldValidation(rule = RuleRegistry.PHP_NAMESPACE_NAME,
67+
message = {PhpNamespaceNameRule.MESSAGE, CONTROLLER_NAME})
6868
private JTextField controllerName;
6969

7070
@FieldValidation(rule = RuleRegistry.NOT_EMPTY,
7171
message = {NotEmptyRule.MESSAGE, ACTION_NAME})
72-
@FieldValidation(rule = RuleRegistry.PHP_NAMESPACE_NAME,
73-
message = {NotEmptyRule.MESSAGE, ACTION_NAME})
72+
@FieldValidation(rule = RuleRegistry.START_WITH_NUMBER_OR_CAPITAL_LETTER,
73+
message = {StartWithNumberOrCapitalLetterRule.MESSAGE, ACTION_NAME})
74+
@FieldValidation(rule = RuleRegistry.ALPHANUMERIC,
75+
message = {AlphanumericRule.MESSAGE, ACTION_NAME})
76+
@FieldValidation(rule = RuleRegistry.PHP_CLASS,
77+
message = {PhpClassRule.MESSAGE, ACTION_NAME})
7478
private JTextField actionName;
7579

7680
/**

0 commit comments

Comments
 (0)