Skip to content

Commit

Permalink
feat:Add translations to all literal strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinpraveengo committed Feb 24, 2025
1 parent b3cda28 commit 6819c7d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 31 deletions.
15 changes: 15 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
"add_attachments": "Add Attachments",
"add_beds": "Add Bed(s)",
"add_beds_to_configure_presets": "Add beds to this location to configure presets for them.",
"add_condition": "Add Condition",
"add_department_team": "Add Department/Team",
"add_details_of_patient": "Add Details of Patient",
"add_encounter": "Add Encounter",
Expand All @@ -306,13 +307,15 @@
"add_notes_about_diagnosis": "Add notes about the diagnosis...",
"add_notes_about_symptom": "Add notes about the symptom...",
"add_notes_about_the_allergy": "Add notes about the allergy",
"add_option": "Add Option",
"add_organizations": "Add Organizations",
"add_patient_updates": "Add Patient Updates",
"add_policy": "Add Insurance Policy",
"add_prescription_medication": "Add Prescription Medication",
"add_prescription_to_consultation_note": "Add a new prescription to this consultation.",
"add_preset": "Add preset",
"add_prn_prescription": "Add PRN Prescription",
"add_question": "Add Question",
"add_questionnaire": "Add Questionnaire",
"add_remarks": "Add remarks",
"add_schedule_exceptions": "Add Schedule Exceptions",
Expand Down Expand Up @@ -578,9 +581,11 @@
"clear_search": "Clear search",
"clear_selection": "Clear selection",
"clear_skill": "Clear Skill",
"clone_questionnaire": "Clone Questionnaire",
"close": "Close",
"close_scanner": "Close Scanner",
"collapse_sidebar": "Collapse Sidebar",
"collect": "Collect",
"combine_files_pdf": "Combine Files To PDF",
"comment_added_successfully": "Comment added successfully",
"comment_min_length": "Comment Should Contain At Least 1 Character",
Expand Down Expand Up @@ -806,6 +811,7 @@
"edit_cover_photo": "Edit Cover Photo",
"edit_facility": "Edit Facility",
"edit_facility_details": "Edit Facility Details",
"edit_form": "Edit Form",
"edit_history": "Edit History",
"edit_location": "Edit Location",
"edit_location_description": "Edit the Location to make any changes",
Expand Down Expand Up @@ -1088,6 +1094,7 @@
"footer_body": "Open Healthcare Network is an open-source public utility designed by a multi-disciplinary team of innovators and volunteers. Open Healthcare Network CARE is a Digital Public Good recognised by the United Nations.",
"forget_password": "Forgot password?",
"forget_password_instruction": "Enter your username, and if it exists, we will send you a link to reset your password.",
"form_preview": "Preview form",
"forms": "Forms",
"frequency": "Frequency",
"from": "from",
Expand Down Expand Up @@ -1379,7 +1386,9 @@
"more_details": "More details",
"more_info": "More Info",
"morning_slots": "Morning Slots",
"move_down": "Move Down",
"move_to_onvif_preset": "Move to an ONVIF Preset",
"move_up": "Move Up",
"moving_camera": "Moving Camera",
"my_doctors": "My Doctors",
"my_organizations": "My Organizations",
Expand Down Expand Up @@ -1470,6 +1479,7 @@
"no_reason_provided": "No reason provided",
"no_records_found": "No Records Found",
"no_remarks": "No remarks",
"no_requested_questionnaires_found": "The requested questionnaire could not be found.",
"no_resource_requests_found": "No requests found",
"no_resources_found": "No resources found",
"no_results": "No results",
Expand Down Expand Up @@ -1729,7 +1739,9 @@
"preset_name_placeholder": "Specify an identifiable name for the new preset",
"preset_updated": "Preset updated",
"prev_sessions": "Prev Sessions",
"preview": "Preview",
"previous": "Previous",
"previous_form": "Preview form",
"primary_ph_no": "Primary Ph No.",
"primary_phone_no": "Primary ph. no.",
"principal": "Principal",
Expand Down Expand Up @@ -1758,6 +1770,7 @@
"quantity_approved": "Quantity Approved",
"quantity_requested": "Quantity Requested",
"quantity_required": "Quantity Required",
"question": "Question",
"questionnaire": "Questionnaire",
"questionnaire_error_loading": "Error loading questionnaire",
"questionnaire_not_exist": "The questionnaire you tried to access does not exist.",
Expand Down Expand Up @@ -1821,6 +1834,7 @@
"remove_user_warn": "Are you sure you want to remove {{firstName}} {{lastName}} from this organization? This action cannot be undone.",
"rename": "Rename",
"rename_file": "Rename File",
"repeatable": "Repeatable",
"replace_home_facility": "Replace Home Facility",
"replace_home_facility_confirm": "Are you sure you want to replace",
"replace_home_facility_confirm_as": "as home facility for user",
Expand Down Expand Up @@ -2136,6 +2150,7 @@
"stream_stop_due_to_inativity": "The live feed will stop streaming due to inactivity",
"stream_stopped_due_to_inativity": "The live feed has stopped streaming due to inactivity",
"stream_uuid": "Stream UUID",
"structured_type": "Structured Type",
"sub_category": "Sub Category",
"subject": "Subject",
"subject_type": "Subject Type",
Expand Down
61 changes: 30 additions & 31 deletions src/components/Questionnaire/QuestionnaireEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ function QuestionnaireProperties({
trigger={
<Button variant="outline" className="w-full justify-start">
<CareIcon icon="l-copy" className="mr-2 h-4 w-4" />
Clone Questionnaire
{t("clone_questionnaire")}
</Button>
}
/>
Expand Down Expand Up @@ -750,7 +750,7 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
<CareIcon icon="l-info-circle" className="h-4 w-4" />
<AlertTitle>Not Found</AlertTitle>
<AlertDescription>
The requested questionnaire could not be found.
{t("no_requested_questionnaires_found")}
</AlertDescription>
</Alert>
);
Expand Down Expand Up @@ -813,17 +813,17 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
<h1 className="text-2xl font-bold">
{id
? t("edit") + " " + questionnaire.title
: "Create Questionnaire"}
: t("create_questionnaire")}
</h1>
<p className="text-sm text-gray-500">{questionnaire.description}</p>
</div>
<div className="flex gap-2">
<Button variant="outline" onClick={handleCancel}>
Cancel
{t("cancel")}
</Button>
<Button onClick={handleSave} disabled={isCreating || isUpdating}>
<CareIcon icon="l-save" className="mr-2 h-4 w-4" />
{id ? "Save" : "Create"}
{id ? t("save") : t("create")}
</Button>
</div>
</div>
Expand All @@ -835,14 +835,13 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
<TabsList className="mb-4">
<TabsTrigger value="edit">
<ViewIcon className="w-4 h-4 mr-2" />
Edit form
{t("edit_form")}
</TabsTrigger>
<TabsTrigger value="preview">
<SquarePenIcon className="w-4 h-4 mr-2" />
Preview form
{t("previous_form")}
</TabsTrigger>
</TabsList>

<TabsContent value="edit">
<div className="flex flex-col md:flex-row gap-2">
<div className="space-y-4 md:w-60">
Expand Down Expand Up @@ -948,11 +947,11 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
<div className="space-y-4 flex-1">
<Card>
<CardHeader>
<CardTitle>Basic Information</CardTitle>
<CardTitle>{t("basic_info")}</CardTitle>
</CardHeader>
<CardContent className="space-y-4">
<div>
<Label htmlFor="title">Title</Label>
<Label htmlFor="title">{t("title")}</Label>
<Input
id="title"
value={questionnaire.title}
Expand All @@ -963,7 +962,7 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
</div>

<div>
<Label htmlFor="slug">Slug</Label>
<Label htmlFor="slug">{t("Slug")}</Label>
<Input
id="slug"
value={questionnaire.slug}
Expand All @@ -979,7 +978,7 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
</div>

<div>
<Label htmlFor="desc">Description</Label>
<Label htmlFor="desc">{t("description")}</Label>
<Textarea
id="desc"
value={questionnaire.description || ""}
Expand All @@ -996,7 +995,7 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
<div>
<CardTitle>
<p className="text-sm text-gray-700 font-medium mt-1">
{questionnaire.questions?.length || 0} Question
{questionnaire.questions?.length || 0} {t("question")}
{questionnaire.questions?.length !== 1 ? "s" : ""}
</p>
</CardTitle>
Expand All @@ -1022,7 +1021,7 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
}}
>
<CareIcon icon="l-plus" className="mr-2 h-4 w-4" />
Add Question
{t("add_question")}
</Button>
</CardHeader>
<CardContent className="p-0">
Expand Down Expand Up @@ -1125,7 +1124,7 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
<TabsContent value="preview">
<Card>
<CardHeader>
<CardTitle>Preview</CardTitle>
<CardTitle>{t("preview")}</CardTitle>
</CardHeader>
<CardContent>
<QuestionnaireForm
Expand Down Expand Up @@ -1232,8 +1231,8 @@ function QuestionEditor({
</div>
<div className="flex gap-2 mt-1">
<Badge variant="secondary">{type}</Badge>
{required && <Badge variant="secondary">Required</Badge>}
{repeats && <Badge variant="secondary">Repeatable</Badge>}
{required && <Badge variant="secondary">{t("required")}</Badge>}
{repeats && <Badge variant="secondary">{t("repeatable")}</Badge>}
{type === "group" && questions && questions.length > 0 && (
<Badge variant="secondary">
{questions.length} sub-questions
Expand Down Expand Up @@ -1262,7 +1261,7 @@ function QuestionEditor({
}}
>
<ChevronUp className="mr-2 h-4 w-4" />
Move Up
{t("move_up")}
</DropdownMenuItem>
)}
{!isLast && (
Expand All @@ -1273,7 +1272,7 @@ function QuestionEditor({
}}
>
<ChevronDown className="mr-2 h-4 w-4" />
Move Down
{t("move_down")}
</DropdownMenuItem>
)}
<DropdownMenuSeparator />
Expand All @@ -1285,7 +1284,7 @@ function QuestionEditor({
className="text-destructive"
>
<CareIcon icon="l-trash-alt" className="mr-2 h-4 w-4" />
Delete
{t("delete")}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand All @@ -1312,7 +1311,7 @@ function QuestionEditor({
</div>

<div>
<Label>Description</Label>
<Label>{t("description")}</Label>
<Textarea
value={question.description || ""}
onChange={(e) => updateField("description", e.target.value)}
Expand All @@ -1324,7 +1323,7 @@ function QuestionEditor({
<div className="space-y-4">
<div className="grid grid-cols-2 gap-4">
<div>
<Label>Type</Label>
<Label>{t("type")}</Label>
<Select
value={type}
onValueChange={(val: QuestionType) => {
Expand All @@ -1350,7 +1349,7 @@ function QuestionEditor({

{type === "structured" && (
<div>
<Label>Structured Type</Label>
<Label>{t("structured_type")}</Label>
<Select
value={structured_type ?? "allergy_intolerance"}
onValueChange={(val: StructuredQuestionType) =>
Expand Down Expand Up @@ -1396,7 +1395,7 @@ function QuestionEditor({
id={`required-${getQuestionPath()}`}
/>
<Label htmlFor={`required-${getQuestionPath()}`}>
Required
{t("required")}
</Label>
</div>

Expand All @@ -1407,7 +1406,7 @@ function QuestionEditor({
id={`repeats-${getQuestionPath()}`}
/>
<Label htmlFor={`repeats-${getQuestionPath()}`}>
Repeatable
{t("repeatable")}
</Label>
</div>

Expand Down Expand Up @@ -1444,7 +1443,7 @@ function QuestionEditor({
id={`collect_time-${getQuestionPath()}`}
/>
<Label htmlFor={`collect_time-${getQuestionPath()}`}>
Collect Time
{t("collect")} Time
</Label>
</div>

Expand All @@ -1457,7 +1456,7 @@ function QuestionEditor({
id={`collect_performer-${getQuestionPath()}`}
/>
<Label htmlFor={`collect_performer-${getQuestionPath()}`}>
Collect Performer
{t("collect")} Performer
</Label>
</div>

Expand All @@ -1470,7 +1469,7 @@ function QuestionEditor({
id={`collect_body_site-${getQuestionPath()}`}
/>
<Label htmlFor={`collect_body_site-${getQuestionPath()}`}>
Collect Body Site
{t("collect")} Body Site
</Label>
</div>

Expand All @@ -1483,7 +1482,7 @@ function QuestionEditor({
id={`collect_method-${getQuestionPath()}`}
/>
<Label htmlFor={`collect_method-${getQuestionPath()}`}>
Collect Method
{t("collect")} Method
</Label>
</div>
</div>
Expand Down Expand Up @@ -1637,7 +1636,7 @@ function QuestionEditor({
}}
>
<CareIcon icon="l-plus" className="mr-2 h-4 w-4" />
Add Option
{t("add_option")}
</Button>
</CardContent>
) : (
Expand Down Expand Up @@ -1982,7 +1981,7 @@ function QuestionEditor({
}}
>
<CareIcon icon="l-plus" className="mr-2 h-4 w-4" />
Add Condition
{t("add_condition")}
</Button>
</div>
</div>
Expand Down

0 comments on commit 6819c7d

Please sign in to comment.