Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added German form validation messages #4

Merged
merged 1 commit into from
Jul 24, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions js/source/Input/Abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,27 @@
* @memberof AbstractInput
* @type (object)
*/
defaultValidationMessages: {
valueMissing : "Please fill out this field",
typeMismatch : "",
patternMismatch : "The pattern is mismatched",
rangeUnderflow: "The value is too low",
rangeOverflow: "The value is too high",
tooLong: "The value is too long",
stepMismatch: "Invalid step for the range",
badInput: "The user agent is unable to convert to a value",
customError: ""
defaultValidationMessages: {
en: {
valueMissing : "Please fill out this field",
typeMismatch : "",
patternMismatch : "The pattern is mismatched",
rangeUnderflow: "The value is too low",
rangeOverflow: "The value is too high",
tooLong: "The value is too long",
stepMismatch: "Invalid step for the range",
badInput: "The user agent is unable to convert to a value",
customError: "" },
de: {
valueMissing : "Bitte füllen Sie dieses Feld aus",
typeMismatch : "",
patternMismatch : "Die Eingabe stimmt nicht mit dem vorgegebenen Muster überein",
rangeUnderflow: "Der Wert ist zu niedrig",
rangeOverflow: "Der Wert ist zu hoch",
tooLong: "Die Eingabe ist zu lang",
stepMismatch: "Ungültiger Schritt in diesem Bereich",
badInput: "Der Browser kann die Eingabe nicht in einen gültigen Wert umwandeln",
customError: "" }
},
/**
* Constraint validation API
Expand Down Expand Up @@ -355,8 +366,11 @@
}
this.validity[ prop ] = true;
this.validity.valid = false;
if (language!='de') {
language='en';
}
this.validationMessage = validationMessage ||
this.defaultValidationMessages[ prop ];
this.defaultValidationMessages[ language ][ prop ];
this.shimConstraintValidationApi();
},
/**
Expand Down Expand Up @@ -425,4 +439,4 @@
[ msg || this.validationMessage ]);
}
};
};
};