Skip to content

Commit faf0781

Browse files
committed
MORE-Platform#322: add english translations and improve goal template page layout
1 parent 586f6e4 commit faf0781

4 files changed

Lines changed: 292 additions & 25 deletions

File tree

src/components/GoalList.vue

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,34 @@ Licensed under the Elastic License 2.0. */
5454
);
5555
5656
const goalTemplateListMap: ComputedRef<GoalTemplateMap[]> = computed(() => {
57-
return goalTemplateStore.goalTemplatesMap.map((item) => ({
58-
...item,
59-
goalTypeLabel: t(item.goalTypeLabel),
60-
categoryKind: t(`goaltemplate.factory.type.${item.categoryKind}Goal`),
61-
categoryTopics: goalTemplateStore.getTopicNames(item.categoryTopics ?? []),
62-
adhearanceCheckLabels:
63-
item.adhearanceCheckLabels?.length === 0
64-
? '-'
65-
: item.adhearanceCheckLabels
66-
.map((ad: string) =>
67-
t(`goaltemplate.goalTemplateList.meassurmentTimes.itmes.${ad}`),
57+
return goalTemplateStore.goalTemplatesMap.map(
58+
(item) =>
59+
({
60+
...item,
61+
goalTypeLabel: t(item.goalTypeLabel),
62+
categoryKind: t(`goaltemplate.factory.type.${item.categoryKind}Goal`),
63+
categoryTopics: goalTemplateStore.getTopicNames(
64+
item.categoryTopics ?? [],
65+
),
66+
adhearanceCheckLabels:
67+
item.adhearanceCheckLabels?.length === 0
68+
? '-'
69+
: item.adhearanceCheckLabels
70+
.map((ad: string) =>
71+
t(
72+
`goaltemplate.goalTemplateList.meassurmentTimes.itmes.${ad}`,
73+
),
74+
)
75+
.join(','),
76+
observationGroupValues: item.observationGroupIds?.length
77+
? item.observationGroupIds.map((id) =>
78+
observationGroupStatuses.value?.find(
79+
(groupStatus) => groupStatus.value === id.toString(),
80+
),
6881
)
69-
.join(','),
70-
observationGroupValues: item.observationGroupIds?.length
71-
? item.observationGroupIds.map((id) =>
72-
observationGroupStatuses.value?.find(
73-
(groupStatus) => groupStatus.value === id.toString(),
74-
),
75-
)
76-
: [],
77-
} as any));
82+
: [],
83+
}) as any,
84+
);
7885
});
7986
8087
const dialog = useDialog();
@@ -457,9 +464,9 @@ Licensed under the Elastic License 2.0. */
457464
</div>
458465
</div>
459466
<div class="global-goal-settings">
460-
<GoalTemplateMessurementSection :study-id="studyId" />
467+
<GoalTemplateMessurementSection :study-id="studyId" class="mb-8" />
461468
<GoalTemplateCategorySection
462-
class="mt-4"
469+
class="mb-8"
463470
:study-id="studyId"
464471
:study-status="studyStatus"
465472
/>

src/components/subComponents/GoalTemplateCategorySection.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
/>
173173
</Button>
174174
</div>
175-
<p class="mb-4 text-sm text-gray-600">
175+
<p class="mb-4">
176176
{{ t('goaltemplate.goalTemplateList.categories.description') }}
177177
</p>
178178

src/components/subComponents/GoalTemplateMeasssurementSection.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
</Popover>
162162
</div>
163163
</div>
164-
<div class="mb-4 text-sm text-gray-600">
164+
<div class="mb-4">
165165
{{ $t('goaltemplate.goalTemplateList.meassurementTimes.description') }}
166166
</div>
167167
<div

src/i18n/en.json

Lines changed: 261 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
"error": "Error",
8181
"info": "Info",
8282
"warning": "Warning"
83-
}
83+
},
84+
"unknownPropertyType": "Unknown Type"
8485
},
8586
"footer": {
8687
"aboutMore": "About More"
@@ -109,6 +110,8 @@
109110
"isRequired": "Required",
110111
"lastCollected": "Last collected",
111112
"lastDataReceived": "Last data received",
113+
"min": "Minimum",
114+
"max": "Maximum",
112115
"lastEdited": "Last edited",
113116
"message": "Message",
114117
"modules": "Modules",
@@ -563,6 +566,260 @@
563566
},
564567
"singular": "Observation"
565568
},
569+
"goaltemplate": {
570+
"property": {
571+
"global": {
572+
"appTitle": {
573+
"name": "App Goal Title",
574+
"description": "The default name of the goal displayed in the participant app.",
575+
"placeholder": "Enter app title"
576+
},
577+
"appDescription": {
578+
"name": "App Goal Description",
579+
"description": "The description of the goal displayed to participants in the app. Keep the description as short as possible, otherwise it will take up too much space.",
580+
"placeholder": "Add a short goal description"
581+
},
582+
"goalTitleState": {
583+
"name": "Allow Title Override",
584+
"description": "Allows participants to customize the goal title during personalization in the app.",
585+
"placeholder": "Allow overriding"
586+
},
587+
"days-of-week": {
588+
"name": "Days of the Week",
589+
"description": "Days of the week range",
590+
"placeholder-min": "Minimum value",
591+
"placeholder-max": "Maximum value"
592+
},
593+
"self-report-time": {
594+
"name": "Notification Time",
595+
"description": "This is the time at which the notification is sent to participants.",
596+
"placeholder": "Select times"
597+
}
598+
},
599+
"amountOfGoal": {
600+
"partOfTemplate": "Part of the preview",
601+
"section": {
602+
"configuration": {
603+
"name": "Goal Configuration",
604+
"description": "Here you can configure the goal template. The configured values allow participants to personalize the goal in the app."
605+
},
606+
"goal": {
607+
"name": "Configure Goal Settings",
608+
"description": "The following goal settings define which values are available to participants for personalizing the goal."
609+
},
610+
"status-texts": {
611+
"name": "Status Texts",
612+
"description": "These texts are displayed in the app based on an algorithm. They should be motivating texts that encourage participants."
613+
},
614+
"self-report": {
615+
"name": "Self-Report Notification",
616+
"description": "Here you can send a notification to participants at a specific time to verify goal achievement."
617+
}
618+
},
619+
"goal-preview": {
620+
"name": "Goal Preview",
621+
"description": "The goal is displayed in the app as follows:",
622+
"partOfTemplate": "Part of the preview"
623+
},
624+
"goal": {
625+
"name": "Goal Settings",
626+
"description": "These are the options for the goal settings that participants can use to customize their personal goal.",
627+
"amount": {
628+
"name": "Amount",
629+
"description": "Range for goal achievement",
630+
"placeholder-min": "Minimum value",
631+
"placeholder-max": "Maximum value"
632+
},
633+
"unit": {
634+
"name": "Unit",
635+
"description": "The unit for goal values (e.g. glass of water)",
636+
"placeholder": "Enter unit"
637+
}
638+
},
639+
"status-100-reached": {
640+
"name": "100% Reached",
641+
"description": "Text displayed when 100% of the goal is achieved.",
642+
"placeholder": "Enter status text for '100%'"
643+
},
644+
"status-75-reached": {
645+
"name": "75% Reached",
646+
"description": "Text displayed when 75%+ of the goal is achieved.",
647+
"placeholder": "Enter status text for '75%'"
648+
},
649+
"status-not-reached": {
650+
"name": "Not Yet Reached",
651+
"description": "Text displayed between 0 and 75% goal achievement.",
652+
"placeholder": "Enter status text for 'not yet reached'"
653+
},
654+
"self-report-question": {
655+
"name": "Question Text",
656+
"description": "This is the message sent to participants.",
657+
"placeholder": "Enter question text"
658+
},
659+
"status-day-not-consumed": {
660+
"name": "Nothing Consumed",
661+
"description": "This status is displayed when nothing was consumed that day.",
662+
"placeholder": "Enter status text for 'nothing consumed'"
663+
},
664+
"status-day-under-limit": {
665+
"name": "Below the Limit",
666+
"description": "This status is displayed when the participant is below the limit.",
667+
"placeholder": "Enter status text for 'below the limit'"
668+
},
669+
"status-day-over-limit": {
670+
"name": "Above the Limit",
671+
"description": "This status is displayed when the limit has been exceeded.",
672+
"placeholder": "Enter status text for 'above the limit'"
673+
}
674+
},
675+
"reduceAmountOf": {
676+
"goal": {
677+
"activity": {
678+
"name": "Activity",
679+
"description": "What is being done?",
680+
"placeholder": "Enter activity"
681+
}
682+
}
683+
}
684+
},
685+
"dialog": {
686+
"deleteMsg": {
687+
"confirm": "Do you really want to delete this goal template?",
688+
"intro": "You are about to delete the following goal template:",
689+
"warning": "A deleted goal template cannot be restored. If you delete the goal template, all configurations will be lost."
690+
},
691+
"header": {
692+
"clone": "Clone Goal Template",
693+
"create": "Add Goal Template",
694+
"delete": "Delete Goal Template",
695+
"edit": "Edit Goal Template",
696+
"view": "Goal Template Details"
697+
},
698+
"msg": {
699+
"delete": "A deleted goal template cannot be restored! Do you really want to delete the goal template?"
700+
}
701+
},
702+
"label": {
703+
"goalTemplateTitle": "Template Title",
704+
"goalTitle": "Goal Title",
705+
"categoryTitle": "Category Title"
706+
},
707+
"error": {
708+
"addParticipantInfo": "Participant information is a required field. Please add a description.",
709+
"addTitle": "The goal template title is a required field. Please add a title.",
710+
"addCategory": "The category is a required field. Please select at least one category.",
711+
"noValidField": "Error in value {key}: {message}",
712+
"addSchedule": "Please select at least one measurement time.",
713+
"integerRange": "The minimum value must not be greater than the maximum value.",
714+
"integerRangeMinLimit": "The value must not be smaller than {min}.",
715+
"integerRangeMaxLimit": "The value must not be greater than {max}.",
716+
"noSimpleSchedulerOptions": "No measurement times have been set yet. Please close the dialog and configure at least one measurement time to create a goal template."
717+
},
718+
"factory": {
719+
"trink-amount-of": {
720+
"description": "This goal defines daily fluid intake. It supports building a healthy drinking habit and drinking enough regularly.",
721+
"name": "Fluid Intake"
722+
},
723+
"eat-amount-of": {
724+
"description": "This goal defines the daily intake of a product. It supports building healthy eating habits.",
725+
"name": "Food Intake"
726+
},
727+
"reduce-amount-of": {
728+
"description": "This goal helps limit unhealthy consumption (e.g. smoking, alcohol).",
729+
"name": "Reduce Consumption"
730+
},
731+
"smoking": {
732+
"description": "This goal helps reduce cigarette consumption and gradually achieve lower smoking levels in daily life.",
733+
"title": "Reduce Smoking"
734+
},
735+
"type": {
736+
"behavioralGoal": "Behavioral Goal",
737+
"outcomeGoal": "Outcome Goal"
738+
},
739+
"category": {
740+
"nutrition": "Nutrition",
741+
"smoking": "Smoking"
742+
}
743+
},
744+
"goalTemplateList": {
745+
"action": {
746+
"add": "Add Goal Template"
747+
},
748+
"description": "A goal template is created from a goal type and customized for the study and participants. It consists of a goal definition, customizable values, and a measurable component. These templates are used in the app to allow participants to configure and create a personal goal.",
749+
"emptyListMsg": "Manage or add a goal template. They will be displayed here.",
750+
"title": "Goal Templates",
751+
"configuration": "Global Template Configuration",
752+
"meassurementTimes": {
753+
"title": "Measurement and Reminder Times",
754+
"description": "The times defined here are used to check collected data for goal achievement at a specific point in time. This may involve comparing linked data such as Garmin step data or sending reminders for simple goals such as daily water consumption.",
755+
"notSet": "No measurement and reminder times have been defined yet.",
756+
"adaptMeassurment": "Adjust Measurement Times",
757+
"meassurements": "Measurement Times",
758+
"set": "Defined Measurement Times",
759+
"meassurementsDescription": "At these times, measurements related to goals are checked to verify goal achievement.",
760+
"times": {
761+
"morning": "Morning",
762+
"noon": "Noon",
763+
"afternoon": "Afternoon",
764+
"evening": "Evening",
765+
"night": "Night"
766+
},
767+
"planer": "The times configured here trigger a measurement request that is sent directly to the participants' app."
768+
},
769+
"categories": {
770+
"title": "Template Categories",
771+
"description": "Template categories are displayed in the app as groups for goals. You can use them to organize and group your goals.",
772+
"edit": "Edit Categories",
773+
"add": "Add Category",
774+
"delete": "Delete Category",
775+
"namePlaceholder": "Category name",
776+
"descriptionPlaceholder": "Optional description"
777+
}
778+
},
779+
"goalTemplateTopicList": {
780+
"emptyListMessage": "No categories have been added yet. Once available, they will appear in this list.",
781+
"labels": {
782+
"delete": "Delete Goal Category",
783+
"add": "Add Goal Category"
784+
},
785+
"dialog": {
786+
"header": {
787+
"delete": "Delete Goal Category"
788+
},
789+
"msg": {
790+
"delete": "Are you sure you want to delete this goal category? All associated goals will also be deleted."
791+
},
792+
"deleteMsg": {
793+
"intro": "You are about to delete the following goal category:",
794+
"warning": "A deleted goal category cannot be restored. If you delete the goal category, all configurations will be lost.",
795+
"confirm": "Do you really want to delete this goal category?"
796+
}
797+
}
798+
},
799+
"placeholder": {
800+
"chooseTemplateType": "Select goal template type",
801+
"enterMainPurpose": "Add the study goals."
802+
},
803+
"plural": "Goal Templates",
804+
"props": {
805+
"categoryTitle": "Category",
806+
"description": "Description",
807+
"goalType": "Goal Type",
808+
"goalCategory": "Goal Category",
809+
"adhearanceCheck": "Measurement Times",
810+
"reminder": {
811+
"false": "No Reminder",
812+
"true": "Reminder"
813+
},
814+
"goalTemplateType": {
815+
"liquidity": "Fluid Intake",
816+
"smoking": "Quit Smoking"
817+
},
818+
"type": "Type",
819+
"dataHealth": "Status"
820+
},
821+
"singular": "Goal Template"
822+
},
566823
"participants": {
567824
"applicationAccess": {
568825
"title": "Application access",
@@ -1294,15 +1551,18 @@
12941551
"cloneObservation": "Clone observation",
12951552
"copyStudyUrl": "Share study",
12961553
"deleteCollaborator": "Delete collaborator",
1554+
"cloneGoalTemplate": "Clone Goal Template",
12971555
"deleteIntegration": "Delete integration",
12981556
"deleteIntervention": "Delete intervention",
12991557
"deleteObservation": "Delete observation",
13001558
"deleteParticipantBtn": "Delete participant",
13011559
"deleteStudyBtn": "Delete study",
1560+
"deleteGoalTemplate": "Delete Goal Template",
13021561
"deleteStudyGroupBtn": "Delete study group",
13031562
"deleteObservationGroupBtn": "Delete observation group",
13041563
"editBtn": "Edit shown properties.",
13051564
"goToStudy": "Go to study",
1565+
"deleteGoalCategory": "Delete Goal Category",
13061566
"saveChanges": "Save changes",
13071567
"showQrCode": "Show QR code",
13081568
"showStudy": "Click on row to show study details page.",

0 commit comments

Comments
 (0)