Skip to content

Commit

Permalink
Add hindi support for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abhaykumarvats committed Jan 9, 2023
1 parent a793a4b commit f970bcc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/AddEditQ.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
16 changes: 16 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: "कृपया कम से कम एक वस्तु डालें",
},
};

0 comments on commit f970bcc

Please sign in to comment.