added new translations
This commit is contained in:
commit
c7f7cfd534
|
|
@ -113,4 +113,7 @@ export const locale = {
|
|||
TICKETS: "Tickets",
|
||||
NEW_TICKET: "New Ticket",
|
||||
CONTACTS: "Contracts",
|
||||
|
||||
REQUIRED_VALIDATION: "This field is required",
|
||||
MIN_LENGTH_VALIDATION: "This field should be at least {min} characters long",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -113,4 +113,8 @@ export const locale = {
|
|||
TICKETS: "Tickets",
|
||||
NEW_TICKET: "New Ticket",
|
||||
CONTACTS: "Contracts",
|
||||
SHORT_NAME: "Short Name",
|
||||
|
||||
REQUIRED_VALIDATION: "This field is required",
|
||||
MIN_LENGTH_VALIDATION: "This field should be at least {min} characters long",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -113,4 +113,7 @@ export const locale = {
|
|||
TICKETS: "Tickets",
|
||||
NEW_TICKET: "New Ticket",
|
||||
CONTACTS: "Contracts",
|
||||
|
||||
REQUIRED_VALIDATION: "This field is required",
|
||||
MIN_LENGTH_VALIDATION: "This field should be at least {min} characters long",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -234,6 +234,9 @@ import { storeToRefs } from 'pinia';
|
|||
import router from "@/router";
|
||||
import Logo from "@/components/logo/Main.vue";
|
||||
import Lang from "@/components/lang/Main.vue";
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n({});
|
||||
|
||||
const countriesStore = useCountriesStore();
|
||||
|
||||
|
|
@ -252,23 +255,29 @@ const formData = reactive({
|
|||
|
||||
const rules = {
|
||||
firstname: {
|
||||
required: helpers.withMessage('This field cannot be empty', required),
|
||||
minLength: minLength(2),
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required),
|
||||
minLength: helpers.withMessage(
|
||||
t("MIN_LENGTH_VALIDATION", {min: 2}), minLength(2)
|
||||
),
|
||||
},
|
||||
lastname: {
|
||||
required,
|
||||
minLength: minLength(2),
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required),
|
||||
minLength: helpers.withMessage(
|
||||
t("MIN_LENGTH_VALIDATION", {min: 2}), minLength(2)
|
||||
),
|
||||
},
|
||||
email: {
|
||||
required,
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required),
|
||||
email,
|
||||
},
|
||||
password: {
|
||||
required,
|
||||
minLength: minLength(8)
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required),
|
||||
minLength: helpers.withMessage(
|
||||
t("MIN_LENGTH_VALIDATION", {min: 8}), minLength(8)
|
||||
)
|
||||
},
|
||||
country: {
|
||||
required
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required)
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -139,12 +139,15 @@
|
|||
|
||||
<script setup>
|
||||
import { reactive, ref, toRefs, onBeforeMount } from "vue";
|
||||
import { required } from "@vuelidate/validators";
|
||||
import { required, helpers } from "@vuelidate/validators";
|
||||
import { useVuelidate } from "@vuelidate/core";
|
||||
import { useCategoriesStore } from "@/stores";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useTicketsStore } from "@/stores";
|
||||
import _ from "lodash";
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n({});
|
||||
|
||||
const categoriesStore = useCategoriesStore();
|
||||
|
||||
|
|
@ -162,15 +165,15 @@ const formData = reactive({
|
|||
|
||||
const rules = {
|
||||
title: {
|
||||
required,
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required),
|
||||
},
|
||||
|
||||
content: {
|
||||
required,
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required),
|
||||
},
|
||||
|
||||
category_id: {
|
||||
required,
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required),
|
||||
// todo numeric validation
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -158,10 +158,14 @@ import {
|
|||
required,
|
||||
minLength,
|
||||
// email,
|
||||
helpers
|
||||
} from "@vuelidate/validators";
|
||||
import { useVuelidate } from "@vuelidate/core";
|
||||
import { useAuthStore } from "@/stores";
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n({});
|
||||
|
||||
const authStore = useAuthStore();
|
||||
const { user } = storeToRefs(authStore);
|
||||
|
|
@ -178,12 +182,16 @@ const formData = reactive({
|
|||
|
||||
const rules = {
|
||||
firstname: {
|
||||
required,
|
||||
minLength: minLength(2),
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required),
|
||||
minLength: helpers.withMessage(
|
||||
t("MIN_LENGTH_VALIDATION", {min: 2}), minLength(2)
|
||||
),
|
||||
},
|
||||
lastname: {
|
||||
required,
|
||||
minLength: minLength(2),
|
||||
required: helpers.withMessage(t("REQUIRED_VALIDATION"), required),
|
||||
minLength: helpers.withMessage(
|
||||
t("MIN_LENGTH_VALIDATION", {min: 2}), minLength(2)
|
||||
),
|
||||
},
|
||||
// email: {
|
||||
// required,
|
||||
|
|
@ -191,7 +199,9 @@ const rules = {
|
|||
// },
|
||||
password: {
|
||||
// required,
|
||||
minLength: minLength(8)
|
||||
minLength: helpers.withMessage(
|
||||
t("MIN_LENGTH_VALIDATION", {min: 8}), minLength(8)
|
||||
)
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue