locale based error message

This commit is contained in:
rahul shukla 2019-09-16 13:51:47 +05:30
parent 53030b2a21
commit 62b2a3f9c3
4 changed files with 44 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=71f03d05d9690fe24784",
"/js/shop.js": "/js/shop.js?id=053b23126964b10d1ce6",
"/css/shop.css": "/css/shop.css?id=426d876808f107691dc6"
}

View File

@ -5,7 +5,19 @@ window.axios = require("axios");
require("./bootstrap");
require("ez-plus/src/jquery.ez-plus.js");
Vue.use(VeeValidate);
const dictionary = {
ar: {
required: (field) => 'حقل' + field + ' مطلوب',
email: (field) => + field + 'يجب ان يكون بريدا اليكتروني صحيح',
}
};
Vue.use(VeeValidate, {
dictionary: {
ar: { messages: dictionary.ar}
}
});
Vue.prototype.$http = axios
window.eventBus = new Vue();
@ -18,12 +30,14 @@ $(document).ready(function () {
el: "#app",
data: {
modalIds: {}
modalIds: {},
},
mounted: function () {
this.addServerErrors();
this.addFlashMessages();
this.$validator.localize(document.documentElement.lang);
},
methods: {

View File

@ -0,0 +1,26 @@
[{
required : (field) => 'حقل' + field + ' مطلوب',
alpha : (field) => + field + ' يجب ان يحتوي على حروف فقط',
alpha_num : (field) => + field + ' قد يحتوي فقط على حروف وارقام',
min : (field) => 'الحقل ' + field + ' يجب ان يحتوي على {length} حروف على الأقل',
numeric : (field) => +field+ ' يمكن ان يحتوي فقط على ارقام',
oneOf : (field) => 'الحقل ' + field + 'يجب ان يكون قيمة صحيحة',
regex : (field) => 'الحقل' + field+ ' غير صحيح',
required_if : (field) => 'حقل' + field + ' مطلوب',
size : (field) => + field + ' يجب ان يكون اقل من {size} كيلوبايت',
min_value : (field) => 'قيمة الحقل' + field + ' يجب ان تكون اكبر من {min} او تساويها',
alpha_spaces : (field) => + field + ' قد يحتوي فقط على حروف ومسافات',
between : (field) => 'قيمة ' +field+ ' يجب ان تكون ما بين {min} و {max}',
confirmed : (field) => + field + ' لا يماثل التأكيد',
digits : (field) => + field + ' يجب ان تحتوي فقط على ارقام والا يزيد عددها عن {length} رقم',
dimensions : (field) => + field + ' يجب ان تكون بمقاس {width} بكسل في {height} بكسل',
email : (field) => + field + ' يجب ان يكون بريدا اليكتروني صحيح',
excluded : (field) => 'الحقل' + field +'غير صحيح',
ext : (field) =>'نوع مل'+ field + 'غير صحيح',
image : (field) => + field + ' يجب ان تكون صورة',
integer : (field) => 'الحقل ' +field + ' يجب ان يكون عدداً صحيحاً',
length : (field) => 'حقل'+ field + ' يجب الا يزيد عن {length}',
max_value : (field) => 'قيمة الحقل '+ field + ' يجب ان تكون اصغر من {min} او تساويها',
max : (field) => 'الحقل' + field + 'يجب ان يحتوي على {length} حروف على الأكثر',
mimes : (field) => 'نوع ملف' + field + 'غير صحيح'
}]