diff --git a/src/lib/AddEditQ.svelte b/src/lib/AddEditQ.svelte index f95db67..534a642 100644 --- a/src/lib/AddEditQ.svelte +++ b/src/lib/AddEditQ.svelte @@ -55,7 +55,7 @@ if (!newItemValue) return; if (newItemValue.length > 5) { - error = "item name must be less than 5 characters"; + error = $labels.ITEM_LESS_THAN_5_ERROR; return; } @@ -76,17 +76,17 @@ const handleQueueSave = () => { if (!name) { - error = "please enter queue name"; + error = $labels.ENTER_QUEUE_NAME_ERROR; return; } if (name.length > 10) { - error = "queue name must be less than 10 characters"; + error = $labels.QUEUE_LESS_THAN_10_ERROR; return; } if (!items.length) { - error = "please add atleast one item"; + error = $labels.ITEM_ATLEAST_ONE_ERROR; return; } diff --git a/src/lib/constants.ts b/src/lib/constants.ts index f6f8641..70bdfa6 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -29,4 +29,20 @@ export const LABELS: LabelsType = { }, EDIT_QUEUE: { EN: "Edit Queue", HI: "पंक्ति एडिट करें" }, DELETE: { EN: "Delete", HI: "पंक्ति हटाएँ" }, + ITEM_LESS_THAN_5_ERROR: { + EN: "item name must be less than 5 characters", + HI: "वस्तु का नाम 5 अक्षरों से काम का होना चाहिए", + }, + ENTER_QUEUE_NAME_ERROR: { + EN: "please enter queue name", + HI: "कृपया पंक्ति का नाम डालें", + }, + QUEUE_LESS_THAN_10_ERROR: { + EN: "queue name must be less than 10 characters", + HI: "पंक्ति का नाम 10 अक्षरों से काम का होना चाहिए", + }, + ITEM_ATLEAST_ONE_ERROR: { + EN: "please add atleast one item", + HI: "कृपया कम से कम एक वस्तु डालें", + }, };