Skip to content

Commit

Permalink
Merge pull request #235 from dBucik/translations
Browse files Browse the repository at this point in the history
fix: 🐛 Different default error msg for inputs like radio, check
  • Loading branch information
HejdaJakub authored Jun 29, 2023
2 parents 7da0be3 + ebb913f commit cc0682b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ public interface PerunRegistrarTranslation extends PerunTranslation {
@DefaultMessage("You must select at least one option!")
public String cantBeEmptyCheckBox();

@DefaultMessage("You must check this box!")
public String cantBeEmptySingleCheckBox();

@DefaultMessage("Incorrect email address format!")
public String incorrectEmail();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public boolean validateLocal(Checkbox checkbox) {
} else {
// single checkbox - prefer own error message
setResult(Result.EMPTY);
checkbox.setRawStatus(getErrorMsgOrDefault(checkbox), ValidationState.ERROR);
String msg = getErrorMsgOrDefault(checkbox);
if (msg.equals(getTransl().incorrectFormat())) {
msg = getTransl().cantBeEmptySingleCheckBox();
}
checkbox.setRawStatus(msg, ValidationState.ERROR);
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ duplicateKeys=Každý klíč musí být unikátní!
cantBeEmpty=Položka <b>nesmí být prázdná!</b>
cantBeEmptySelect=Musíte vybrat jednu z možností!
cantBeEmptyCheckBox=Musíte vybrat alespoň jednu možnost!
cantBeEmptySingleCheckBox=Tuhle položku musíte označit!
incorrectEmail=Neplatný formát e-mailové adresy!
checkAndSubmit=Zkontrolovat a odeslat formulář
passEmpty=Heslo <b>nesmí být prázdné!</b>
Expand Down

0 comments on commit cc0682b

Please sign in to comment.