diff --git a/package.json b/package.json index fbd8d36..46f3978 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "typescript": "tsc", "test": "jest --config jest.config.js --passWithNoTests --color", "verify": "turbo lint typescript test --color", - "extract-translations": "i18next 'src/**/*.component.tsx' --config ./i18next-parser.config.js", + "extract-translations": "i18next 'src/**/*.component.tsx' 'src/index.ts' --config ./i18next-parser.config.js", "coverage": "yarn test -- --coverage", "postinstall": "husky install" }, diff --git a/src/components/create-dashboard-link.component.tsx b/src/components/create-dashboard-link.component.tsx index 36740e3..aa34df9 100644 --- a/src/components/create-dashboard-link.component.tsx +++ b/src/components/create-dashboard-link.component.tsx @@ -1,6 +1,7 @@ import React, { useMemo } from 'react'; import { ConfigurableLink } from '@openmrs/esm-framework'; import { BrowserRouter, useLocation } from 'react-router-dom'; +import { useTranslation } from 'react-i18next'; export interface DashboardLinkConfig { name: string; @@ -9,6 +10,7 @@ export interface DashboardLinkConfig { } function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) { + const { t } = useTranslation(); const { name, title } = dashboardLinkConfig; const location = useLocation(); const spaBasePath = `${window.spaBase}/home`; @@ -24,7 +26,7 @@ function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: Dash to={`${spaBasePath}/${name}`} className={`cds--side-nav__link ${navLink.match(name) && 'active-left-nav-link'}`} > - {title} + {t(title)} ); } diff --git a/src/components/orders-table/orders-data-table.component.tsx b/src/components/orders-table/orders-data-table.component.tsx index 88a5634..9a2f87a 100644 --- a/src/components/orders-table/orders-data-table.component.tsx +++ b/src/components/orders-table/orders-data-table.component.tsx @@ -25,7 +25,7 @@ import { formatDate, parseDate, usePagination } from '@openmrs/esm-framework'; import { type Order } from '@openmrs/esm-patient-common-lib'; import { useLabOrders, useSearchGroupedResults } from '../../laboratory-resource'; import type { FulfillerStatus, OrdersDataTableProps } from '../../types'; -import { OrdersDateRangePicker } from './orders-date-range-picker'; +import { OrdersDateRangePicker } from './orders-date-range-picker.component'; import ListOrderDetails from './list-order-details.component'; import styles from './orders-data-table.scss'; diff --git a/src/components/orders-table/orders-date-range-picker.tsx b/src/components/orders-table/orders-date-range-picker.component.tsx similarity index 100% rename from src/components/orders-table/orders-date-range-picker.tsx rename to src/components/orders-table/orders-date-range-picker.component.tsx diff --git a/src/index.ts b/src/index.ts index 8f53a0c..53a9558 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,6 +15,7 @@ export const importTranslation = require.context('../translations', false, /.jso export const root = getSyncLifecycle(rootComponent, options); export const laboratoryDashboardLink = getSyncLifecycle( + // t('Laboratory', 'Laboratory') createHomeDashboardLink({ name: 'laboratory', slot: 'laboratory-dashboard-slot', @@ -36,32 +37,37 @@ export const rejectLabRequestModal = getAsyncLifecycle( ); // Tables and tiles - +// t('Tests ordered', 'Tests ordered') export const allLabRequestsTable = getAsyncLifecycle( () => import('./lab-tabs/data-table-extensions/tests-ordered-table.extension'), options, ); +// t('In progress', 'In progress') export const inprogressLabRequestsTable = getAsyncLifecycle( () => import('./lab-tabs/data-table-extensions/in-progress-lab-requests-table.extension'), options, ); +// t('Completed', 'Completed') export const completedLabRequestsTable = getAsyncLifecycle( () => import('./lab-tabs/data-table-extensions/completed-lab-requests-table.extension'), options, ); +// t('Worklist', 'Worklist') export const worklistTile = getAsyncLifecycle( () => import('./lab-tiles/in-progress-lab-requests-tile.component'), options, ); +// t("Referred tests", "Referred tests") export const completedTile = getAsyncLifecycle( () => import('./lab-tiles/completed-lab-requests-tile.component'), options, ); +// t('Ordered tests', 'Ordered tests') export const testOrderedTile = getAsyncLifecycle(() => import('./lab-tiles/all-lab-requests-tile.component'), options); // Actions diff --git a/src/routes.json b/src/routes.json index b9e5e8e..eee1aa9 100644 --- a/src/routes.json +++ b/src/routes.json @@ -84,7 +84,7 @@ "component": "completedTile", "meta": { "name": "referredPanleSlot", - "title": "Referred Tests" + "title": "Referred tests" } }, { diff --git a/translations/en.json b/translations/en.json index 67210bb..65dd2ce 100644 --- a/translations/en.json +++ b/translations/en.json @@ -5,7 +5,9 @@ "cancel": "Cancel", "checkFilters": "Please check the filters above and try again", "completed": "Completed", + "Completed": "Completed", "completedStatus": "COMPLETED", + "dateRange": "Date range", "declinedStatus": "DECLINED", "discard": "Discard", "editResults": "Edit results", @@ -14,9 +16,11 @@ "exceptionStatus": "EXCEPTION", "filterOrdersByStatus": "Filter orders by status", "fulfillerComment": "Fulfiller comment", + "In progress": "In progress", "inProgress": "In progress", "inProgressStatus": "IN_PROGRESS", "laboratory": "Laboratory", + "Laboratory": "Laboratory", "loading": "Loading", "newStatus": "NEW", "nextPage": "Next page", @@ -24,6 +28,7 @@ "noLabRequestsFoundC": "No lab requests found", "onHoldStatus": "ON_HOLD", "orderDate": "Order Date:", + "Ordered tests": "Ordered tests", "ordererName": "Orderer Name: ", "orderInStruction": "Instructions: ", "orderNotPicked": "Order not picked", @@ -39,6 +44,7 @@ "pickupLabRequest": "Pick up lab request", "previousPage": "Previous page", "receivedStatus": "RECEIVED", + "Referred tests": "Referred tests", "reject": "Reject", "rejectLabRequest": "Reject lab request", "rejectLabRequestSuccessMessage": "", @@ -47,10 +53,12 @@ "searchThisList": "Search this list", "tabletOverlay": "Tablet overlay", "testOrdered": "Test ordered: ", + "Tests ordered": "Tests ordered", "testsOrdered": "Tests ordered", "testType": "Test type", "totalOrders": "Total orders", "urgencyStatus": "Urgency: ", "viewTestResults": "View test results", - "worklist": "Worklist" + "worklist": "Worklist", + "Worklist": "Worklist" }