Skip to content

Commit

Permalink
Merge pull request #1 from perscrew/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
arochedy authored Sep 15, 2020
2 parents dce02ec + 3dd99d0 commit 3630527
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# React native form validator
[![Build Status](https://travis-ci.org/perscrew/react-native-form-validator.svg?branch=master)](https://travis-ci.org/perscrew/react-native-form-validator)

React native form validator is a simple library to validate your form fiels with React Native.
React native form validator is a simple library to validate your form fields with React Native.
The library is voluntarily easy to use. You juste have to extends the "ValidationComponent" class on your desired React native form component.

## 1. Installation
Expand Down
9 changes: 9 additions & 0 deletions defaultMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ const defaultMessages = {
maxlength: 'The field "{0}" length must be lower than {1}.',
equalPassword : 'Passwords are differents'
},
//Arabic language
ar: {
numbers: 'الحقل "{0}" يجب أن يكون رقم صحيح',
email: 'الحقل "{0}" يجب أن يكون بريد إلكتروني صحيح',
required: 'الحقل "{0}" مطلوب',
date: 'الحقل "{0}" يجب أن يكون تاريخ صحيح ({1}).',
minlength: 'الحقل "{0}" يجب أن يكون أكثر من {1}.',
maxlength: 'الحقل "{0}" يجب أن يكون أقل من {1}.'
},
// French language
fr: {
numbers: 'Le champ "{0}" doit être un nombre valide.',
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ ValidationComponent.propTypes = {
rules: PropTypes.object, // rules for validations
messages : PropTypes.object // messages for validation errors
}
// DefaultProps for component
ValidationComponent.defaultProps = {
deviceLocale: 'en',
rules: defaultRules,
messages: defaultMessages
};

0 comments on commit 3630527

Please sign in to comment.