Skip to content

Commit

Permalink
improve locale support
Browse files Browse the repository at this point in the history
  • Loading branch information
stuyam committed Jan 2, 2020
1 parent 8c2a7c2 commit 673b59e
Show file tree
Hide file tree
Showing 25 changed files with 135 additions and 210 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "simple-react-validator",
"description": "A simple react form validator inspired by Laravel validation.",
"main": "dist/simple-react-validator.min.js",
"version": "1.4.0",
"version": "1.4.1",
"authors": [
"Stuart Yamartino"
],
Expand Down
9 changes: 4 additions & 5 deletions dist/locale/es.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Simple React Validator v1.4.0 | Created By Dockwa | MIT License | 2017 - Present
// Simple React Validator v1.4.1 | Created By Dockwa | MIT License | 2017 - Present
;(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['simple-react-validator'], factory);
Expand All @@ -11,7 +11,7 @@
"use strict";

// Spanish
var es = {
SimpleReactValidator.addLocale('es', {
accepted: ':attribute debe ser aceptado.',
after: ':attribute debe ser una fecha posterior a :date.',
after_or_equal: ':attribute debe ser una fecha posterior o igual a :date.',
Expand Down Expand Up @@ -46,7 +46,6 @@ var es = {
string: 'El campo :attribute debe ser una cadena de caracteres.',
// typeof : 'The :attribute is not the correct type of :type.',
url: 'El formato :attribute es inválido.'
};
SimpleReactValidator.addLocale('es', es);
return es;
});
return null;
}));
9 changes: 4 additions & 5 deletions dist/locale/fa.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Simple React Validator v1.4.0 | Created By Dockwa | MIT License | 2017 - Present
// Simple React Validator v1.4.1 | Created By Dockwa | MIT License | 2017 - Present
;(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['simple-react-validator'], factory);
Expand All @@ -11,7 +11,7 @@
"use strict";

// Persian
var fa = {
SimpleReactValidator.addLocale('fa', {
accepted: ':attribute مورد قبول قرار نگرفت',
after: ':attribute باید تاریخی بعد از :date باشد.',
after_or_equal: ':attribute باید تاریخی برابر یا بعد از :date باشد.',
Expand Down Expand Up @@ -46,7 +46,6 @@ var fa = {
string: ":attribute باید یک رشته باشد.",
"typeof": ":attribute نوع صحیح :type نوع نیست.",
url: ":attribute باید یک آدرس اینترنتی باشد."
};
SimpleReactValidator.addLocale('fa', fa);
return fa;
});
return null;
}));
9 changes: 4 additions & 5 deletions dist/locale/fr.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Simple React Validator v1.4.0 | Created By Dockwa | MIT License | 2017 - Present
// Simple React Validator v1.4.1 | Created By Dockwa | MIT License | 2017 - Present
;(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['simple-react-validator'], factory);
Expand All @@ -11,7 +11,7 @@
"use strict";

// French
var fr = {
SimpleReactValidator.addLocale('fr', {
accepted: 'Le champ :attribute doit être accepté.',
after: 'Le champ :attribute doit être après :date.',
after_or_equal: 'Le champ :attribute doit correspondre ou bien être après :date.',
Expand Down Expand Up @@ -46,7 +46,6 @@ var fr = {
string: 'Le champ :attribute doit être une chaîne.',
"typeof": "Le champ :attribute n'est pas le type correcte de :type.",
url: 'Le champ :attribute doit être un url.'
};
SimpleReactValidator.addLocale('fr', fr);
return fr;
});
return null;
}));
51 changes: 51 additions & 0 deletions dist/locale/id.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Simple React Validator v1.4.1 | Created By Dockwa | MIT License | 2017 - Present
;(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['simple-react-validator'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('simple-react-validator'));
} else {
root.SimpleReactValidatorLocaleId = factory(root.SimpleReactValidator);
}
}(this, function(SimpleReactValidator) {
"use strict";

// Indonesian
SimpleReactValidator.addLocale('id', {
accepted: ':attribute harus diterima.',
after: ':attribute harus lebih dari :date.',
after_or_equal: ':attribute harus lebih dari atau sama dengan :date.',
alpha: ':attribute hanya boleh berisikan teks.',
alpha_space: ':attribute hanya boleh berisikan teks dan spasi.',
alpha_num: ':attribute hanya boleh berisikan teks dan angka.',
alpha_num_space: ':attribute hanya boleh berisikan teks, angka, dan spasi.',
alpha_num_dash: ':attribute hanya boleh berisikan teks, angka, dan garis datar.',
alpha_num_dash_space: ':attribute hanya boleh berisikan teks, angka, garis datar dan spasi.',
array: ':attribute harus berupa array.',
before: ':attribute harus kurang dari :date.',
before_or_equal: ':attribute harus kurang dari atau sama dengan :date.',
between: ':attribute harus diantara :min dan :max:type.',
"boolean": ':attribute harus berupa boolean.',
card_exp: ':attribute harus berupa tanggal expire yang valid valid expiration date.',
card_num: ':attribute harus berupa nomor kartu kredit.',
currency: ':attribute harus berupa mata uang yang valid.',
date: ':attribute harus berupa tanggal.',
date_equals: ':attribute harus sama dengan :date.',
email: ':attribute harus berupa alamat email yang valid.',
"in": ':attribute terpilih harus :values.',
integer: ':attribute harus berupa integer.',
max: ':attribute harus kurang dari :max:type.',
min: ':attribute harus lebih dari :min:type.',
not_in: ':attribute terpilih tidak boleh sama dngan :values.',
not_regex: ':attribute tidak boleh cocok dengan pola yang ditentukan.',
numeric: ':attribute harus berupa angka.',
phone: ':attribute harus berupa nomor ponsel yang valid.',
regex: ':attribute harus cocok dengan pola yang ditentukan.',
required: ':attribute tidak boleh kosong.',
size: ':attribute harus :size:type.',
string: ':attribute harus berupa string.',
"typeof": ':attribute tida cocok dengan tiipe :type.',
url: ':attribute harus berupa url.'
});
return null;
}));
4 changes: 2 additions & 2 deletions dist/locale/min/es.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/locale/min/fa.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/locale/min/fr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 673b59e

Please sign in to comment.