Skip to content

Commit

Permalink
(fix) Fix duplicate translations (#1180)
Browse files Browse the repository at this point in the history
* (fix) Fix duplicate translations

* Update translation for RTL language compatibility

Co-authored-by: chibongho <[email protected]>

* Fixup

---------

Co-authored-by: chibongho <[email protected]>
  • Loading branch information
denniskigen and chibongho authored Jun 10, 2024
1 parent 1510f81 commit fc00743
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const AppointmentsTable: React.FC<AppointmentsTableProps> = ({ appointments, isL
<Layer className={styles.container}>
<Tile className={styles.headerContainer}>
<div className={isDesktop(layout) ? styles.desktopHeading : styles.tabletHeading}>
<h4>{`${t(tableHeading)} ${t('appointments', 'appointments')}`}</h4>
<h4>{`${t(tableHeading)} ${t('appointments', 'Appointments')}`}</h4>
</div>
</Tile>
<div className={styles.toolbar}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const EndAppointmentModal: React.FC<EndAppointmentModalProps> = ({ patientUuid,
{t('cancel', 'Cancel')}
</Button>
<Button kind="danger" onClick={endAppointment}>
{t('checkOut', 'Check Out')}
{t('checkOut', 'Check out')}
</Button>
</ModalFooter>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('EndAppointmentModal', () => {

render(<EndAppointmentModal appointmentUuid={'abc'} patientUuid={'123'} closeModal={closeModal} />);

const submitButton = screen.getByRole('button', { name: /Check Out/ });
const submitButton = screen.getByRole('button', { name: /check out/i });
expect(submitButton).not.toBeDisabled();
await user.click(submitButton);

Expand All @@ -62,7 +62,7 @@ describe('EndAppointmentModal', () => {

render(<EndAppointmentModal appointmentUuid={'abc'} patientUuid={'123'} closeModal={closeModal} />);

const submitButton = screen.getByRole('button', { name: /Check Out/ });
const submitButton = screen.getByRole('button', { name: /check out/i });
expect(submitButton).not.toBeDisabled();
await user.click(submitButton);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ScheduledAppointments: React.FC<ScheduledAppointmentsProps> = ({ appointme
const responsiveSize = isDesktop(layout) ? 'sm' : 'md';

// added to prevent auto-removal of translations for dynamic keys
// t('checkedIn', 'Checked In');
// t('checkedIn', 'Checked in');
// t('expected', 'Expected');

const [currentTab, setCurrentTab] = useState<string>(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ const AppointmentsForm: React.FC<AppointmentsFormProps> = ({
<Select
id="location"
invalidText="Required"
labelText={t('selectLocation', 'Select a location')}
labelText={t('selectALocation', 'Select a location')}
onChange={onChange}
onBlur={onBlur}
value={value}
Expand Down Expand Up @@ -749,7 +749,7 @@ const AppointmentsForm: React.FC<AppointmentsFormProps> = ({
value={value}
ref={ref}
onBlur={onBlur}>
<SelectItem text={t('selectAppointmentStatus', 'selectAppointmentStatus')} value="" />
<SelectItem text={t('selectAppointmentStatus', 'Select status')} value="" />
{appointmentStatuses?.length > 0 &&
appointmentStatuses.map((appointmentStatus, index) => (
<SelectItem key={index} text={appointmentStatus} value={appointmentStatus}>
Expand Down
1 change: 1 addition & 0 deletions packages/esm-appointments-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
"saveAndClose": "Save and close",
"scheduled": "Scheduled",
"scheduledAppointments": "Scheduled appointments",
"selectALocation": "Select a location",
"selectAppointmentStatus": "Select status",
"selectAppointmentType": "Select an appointment type",
"selectLocation": "Select location",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ChangeStatus: React.FC<ChangeStatusDialogProps> = ({ queueEntry, closeModa
z.object({
location: z.string({ required_error: t('queueLocationRequired', 'Queue location is required') }),
service: z.string({ required_error: t('serviceIsRequired', 'Service is required') }),
status: z.string({ required_error: t('serviceIsRequired', 'Status is required') }),
status: z.string({ required_error: t('statusIsRequired', 'Status is required') }),
priority: z.string({ required_error: t('priorityIsRequired', 'Priority is required') }),
}),
[],
Expand Down Expand Up @@ -254,7 +254,7 @@ const ChangeStatus: React.FC<ChangeStatusDialogProps> = ({ queueEntry, closeModa
<InlineLoading
status="active"
iconDescription={t('submitting', 'Submitting')}
description={t('submitting', 'Submitting...')}
description={t('submitting', 'Submitting')}
/>
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const AddVisitToQueue: React.FC<AddVisitToQueueDialogProps> = ({ visitDetails, c
isLowContrast: true,
title: t('addEntry', 'Add entry'),
kind: 'success',
subtitle: t('queueEntryAddedSuccessfully', 'Queue Entry Added Successfully'),
subtitle: t('queueEntryAddedSuccessfully', 'Queue entry added successfully'),
});
closeModal();
mutateQueueEntries();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const AddProviderQueueRoom: React.FC<AddProviderQueueRoomProps> = ({ providerUui

return (
<div>
<ModalHeader closeModal={closeModal} title={t('addProviderQueueRoom', 'Add provider queue room?')} />
<ModalHeader closeModal={closeModal} title={t('addAProviderQueueRoom', 'Add a provider queue room?')} />
<ModalBody>
<Form onSubmit={onSubmit}>
<section className={styles.section}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ const QueueServiceForm: React.FC<DefaultWorkspaceProps> = ({ closeWorkspace }) =
<Column>
<Layer className={styles.input}>
<Select
labelText={t('selectLocation', 'Select a location')}
labelText={t('selectALocation', 'Select a location')}
id="location"
invalidText="Required"
value={userLocation}
onChange={(event) => setUserLocation(event.target.value)}>
{!userLocation && <SelectItem text={t('selectLocation', 'Select a location')} />}
{!userLocation && <SelectItem text={t('selectALocation', 'Select a location')} />}
{queueLocations.length === 0 && <SelectItem text={t('noLocationsAvailable', 'No locations available')} />}
{queueLocations?.length > 0 &&
queueLocations.map((location) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ const UndoTransitionQueueEntryModal: React.FC<UndoTransitionQueueEntryModalProps
queueEntry={queueEntry}
closeModal={closeModal}
modalParams={{
modalTitle: t('undoTransition', 'Undo Transition'),
modalTitle: t('undoTransition', 'Undo transition'),
modalInstruction,
submitButtonText: t('undoTransition', 'Undo transition'),
submitSuccessTitle: t('queueEntryTransitionUndoSuccessful', 'Undo transition success'),
submitSuccessTitle: t('undoQueueEntryTransitionSuccess', 'Undo transition success'),
submitSuccessText: t('queueEntryTransitionUndoSuccessful', 'Queue entry transition undo success'),
submitFailureTitle: t('queueEntryTransitionUndoFailed', 'Error undoing transition'),
submitAction: (queueEntry) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function QueueTableByStatusMenu() {
const { queues } = useQueues();

return (
<SideNavMenu title={t('serviceQueues', 'Service Queues')} className={styles.queueTableByStatusNavMenu}>
<SideNavMenu title={t('serviceQueues', 'Service queues')} className={styles.queueTableByStatusNavMenu}>
<BrowserRouter>
{queues.map((queue) => (
<QueueTableByStatusLink queue={queue} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const QueueTableByStatus: React.FC<QueueTableByStatusProps> = ({
const url = `/queue-table-by-status/${selectedQueue.uuid}` + (newStatusUuid ? '/' + newStatusUuid : '');
navigate(url);
}}>
<TabList className={styles.tabList} aria-label={t('queueStatus', 'Queue Status')} contained>
<TabList className={styles.tabList} aria-label={t('queueStatus', 'Queue status')} contained>
{allowedStatuses?.map((s) => <Tab key={s?.uuid}>{s?.display}</Tab>)}
{allStatusTabConfig && <Tab>{t('all', 'All')}</Tab>}
</TabList>
Expand Down
7 changes: 5 additions & 2 deletions packages/esm-service-queues-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"actions": "Actions",
"activeVisits": "Active Visits",
"activeVisitsNotInQueue": "Active visits not in queue",
"addAProviderQueueRoom": "Add a provider queue room?",
"addEntry": "Add entry",
"addisitToQueueTooltip": "Add",
"addNewQueueService": "Add New Queue Service",
Expand Down Expand Up @@ -237,9 +238,9 @@
"searchPatient": "Search Patient",
"searchThisList": "Search this list",
"secondaryHelperText": "Type the patient's name or unique ID number",
"selectALocation": "Select a location",
"selectAVisitType": "Select visit type",
"selectFacility": "Select a facility",
"selectLocation": "Select a location",
"selectOption": "Select an option",
"selectProgramType": "Select program type",
"selectQueue": "Select a queue",
Expand All @@ -266,7 +267,8 @@
"startVisitError": "Error starting visit",
"startVisitQueueSuccessfully": "Patient has been added to active visits list and queue.",
"status": "Status",
"submitting": "Submitting...",
"statusIsRequired": "Status is required",
"submitting": "Submitting",
"success": "Success",
"tcaDate": "Tca date",
"temperature": "Temperature",
Expand All @@ -284,6 +286,7 @@
"triageForm": "Triage form",
"triageNote": "Triage note",
"trySearchWithPatientUniqueID": "Try searching with the patient's unique ID number",
"undoQueueEntryTransitionSuccess": "Undo transition success",
"undoTransition": "Undo transition",
"unexpectedServerResponse": "Unexpected Server Response",
"unknown": "Unknown",
Expand Down

0 comments on commit fc00743

Please sign in to comment.