Skip to content

Commit

Permalink
Added translations for left nav links
Browse files Browse the repository at this point in the history
  • Loading branch information
vasharma05 committed Sep 27, 2023
1 parent a3e59ea commit f83b5b5
Show file tree
Hide file tree
Showing 24 changed files with 33 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
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;
title: string;
}

function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) {
// t("Appointments", "Appointments")
const { t } = useTranslation();
const { name, title } = dashboardLinkConfig;
const location = useLocation();
const spaBasePath = `${window.spaBase}/home`;
Expand All @@ -22,7 +25,7 @@ function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: Dash
<ConfigurableLink
to={`${spaBasePath}/${name}`}
className={`cds--side-nav__link ${navLink.match(name) && 'active-left-nav-link'}`}>
{title}
{t(title)}
</ConfigurableLink>
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle, registerBreadcrumbs } from '@openmrs/esm-framework';
import { configSchema } from './config-schema';
import { createDashboardLink } from './createDashboardLink';
import { createDashboardLink } from './createDashboardLink.component';
import { dashboardMeta, appointmentCalendarDashboardMeta } from './dashboard.meta';

export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
Expand Down
1 change: 1 addition & 0 deletions packages/esm-appointments-app/translations/am.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"appointmentNotes": "Appointment Notes",
"appointmentNowVisible": "It is now visible on the Appointments page",
"appointments": "appointment",
"Appointments": "Appointments",
"appointmentsCalendar": "Appointments Calendar",
"appointmentScheduled": "Appointment scheduled",
"appointmentService": "Appointment service",
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 @@ -23,6 +23,7 @@
"appointmentNotes": "Appointment Notes",
"appointmentNowVisible": "It is now visible on the Appointments page",
"appointments": "Appointments",
"Appointments": "Appointments",
"appointmentsCalendar": "Appointments Calendar",
"appointmentScheduled": "Appointment scheduled",
"appointmentService": "Appointment service",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-appointments-app/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"appointmentNotes": "Appointment Notes",
"appointmentNowVisible": "It is now visible on the Appointments page",
"appointments": "appointment",
"Appointments": "Appointments",
"appointmentsCalendar": "Appointments Calendar",
"appointmentScheduled": "Appointment scheduled",
"appointmentService": "Appointment service",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-appointments-app/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"appointmentNotes": "Appointment Notes",
"appointmentNowVisible": "It is now visible on the Appointments page",
"appointments": "appointment",
"Appointments": "Appointments",
"appointmentsCalendar": "Appointments Calendar",
"appointmentScheduled": "Appointment scheduled",
"appointmentService": "Appointment service",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-appointments-app/translations/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"appointmentNotes": "הערות לתור",
"appointmentNowVisible": "התור כעת נראה בעמוד התורים",
"appointments": "תורים",
"Appointments": "Appointments",
"appointmentsCalendar": "Appointments Calendar",
"appointmentScheduled": "התור נקבע",
"appointmentService": "שירות התור",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-appointments-app/translations/km.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"appointmentNotes": "កំណត់សម្គាល់ការណាត់ជួប",
"appointmentNowVisible": "ឥឡូវនេះវាអាចមើលឃើញនៅលើទំព័រណាត់ជួប",
"appointments": "ការណាត់ជួប",
"Appointments": "Appointments",
"appointmentsCalendar": "Appointments Calendar",
"appointmentScheduled": "ការណាត់ជួបតាមកាលវិភាគ",
"appointmentService": "សេវាកម្មណាត់ជួប",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
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;
title: string;
}

function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) {
// t('Patient lists', 'Patient lists')
const { t } = useTranslation();
const { name, title } = dashboardLinkConfig;
const location = useLocation();
const spaBasePath = `${window.spaBase}/home`;
Expand All @@ -22,7 +25,7 @@ function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: Dash
<ConfigurableLink
to={`${spaBasePath}/${name}`}
className={`cds--side-nav__link ${navLink.match(name) && 'active-left-nav-link'}`}>
{title}
{t(title)}
</ConfigurableLink>
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-list-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework';
import { configSchema } from './config-schema';
import { createDashboardLink } from './createDashboardLink';
import { createDashboardLink } from './createDashboardLink.component';
import { dashboardMeta } from './dashboard.meta';
import { setupOffline } from './offline';

Expand Down
1 change: 1 addition & 0 deletions packages/esm-patient-list-app/translations/am.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"offlinePatients": "Offline patients",
"openPatientList": "Add to list",
"pageNumber": "Page number",
"Patient lists": "Patient lists",
"patientLists": "Patient Lists",
"patients": "patients",
"previousPage": "Previous page",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-patient-list-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"offlinePatients": "Offline patients",
"openPatientList": "Add to list",
"pageNumber": "Page number",
"Patient lists": "Patient lists",
"patientLists": "Patient lists",
"patients": "patients",
"previousPage": "Previous page",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-patient-list-app/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"offlinePatients": "Offline patients",
"openPatientList": "Add to list",
"pageNumber": "Page number",
"Patient lists": "Patient lists",
"patientLists": "Patient Lists",
"patients": "patients",
"previousPage": "Previous page",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-patient-list-app/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"offlinePatients": "Patients hors ligne",
"openPatientList": "Ajouter à la liste",
"pageNumber": "Page number",
"Patient lists": "Patient lists",
"patientLists": "Listes de patients",
"patients": "Patients",
"previousPage": "Previous page",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-patient-list-app/translations/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"offlinePatients": "מטופלים במצב לא מקוון",
"openPatientList": "הוסף לרשימה",
"pageNumber": "Page number",
"Patient lists": "Patient lists",
"patientLists": "רשימות מטופלים",
"patients": "מטופלים",
"previousPage": "Previous page",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-patient-list-app/translations/km.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"offlinePatients": "អ្នកជំងឺក្រៅប្រព័ន្ធ/បណ្តាញ",
"openPatientList": "បន្ថែម​ទៅក្នុង​បញ្ជី",
"pageNumber": "Page number",
"Patient lists": "បញ្ជីអ្នកជំងឺ",
"patientLists": "បញ្ជីអ្នកជំងឺ",
"patients": "អ្នកជំងឺ",
"previousPage": "Previous page",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
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;
title: string;
}

function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) {
// t('Service queues','Service queues')
const { t } = useTranslation();
const { name, title } = dashboardLinkConfig;
const location = useLocation();
const spaBasePath = `${window.spaBase}/home`;
Expand All @@ -22,7 +25,7 @@ function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: Dash
<ConfigurableLink
to={`${spaBasePath}/${name}`}
className={`cds--side-nav__link ${navLink.match(name) && 'active-left-nav-link'}`}>
{title}
{t(title)}
</ConfigurableLink>
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-service-queues-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle, registerBreadcrumbs } from '@openmrs/esm-framework';
import { configSchema } from './config-schema';
import { createDashboardLink } from './createDashboardLink';
import { createDashboardLink } from './createDashboardLink.component';
import { dashboardMeta } from './dashboard.meta';

export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
Expand Down
1 change: 1 addition & 0 deletions packages/esm-service-queues-app/translations/am.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
"serve": "Serve",
"servePatient": "Serve patient",
"service": "Service",
"Service queues": "Service queues",
"serviceQueue": "Service queue",
"serviceQueues": "Service queues",
"sex": "Sex",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-service-queues-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
"serve": "Serve",
"servePatient": "Serve patient",
"service": "Service",
"Service queues": "Service queues",
"serviceQueue": "Service queue",
"serviceQueues": "Service queues",
"sex": "Sex",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-service-queues-app/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
"serve": "Serve",
"servePatient": "Serve patient",
"service": "Service",
"Service queues": "Service queues",
"serviceQueue": "Service queue",
"serviceQueues": "Service queues",
"sex": "Sex",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-service-queues-app/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
"serve": "Serve",
"servePatient": "Serve patient",
"service": "Service",
"Service queues": "Service queues",
"serviceQueue": "Service queue",
"serviceQueues": "Service queues",
"sex": "Sex",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-service-queues-app/translations/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
"serve": "Serve",
"servePatient": "Serve patient",
"service": "שירות",
"Service queues": "Service queues",
"serviceQueue": "תור שירות",
"serviceQueues": "Service queues",
"sex": "מין",
Expand Down
1 change: 1 addition & 0 deletions packages/esm-service-queues-app/translations/km.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
"serve": "Serve",
"servePatient": "Serve patient",
"service": "សេវា",
"Service queues": "Service queues",
"serviceQueue": "ជួរសេវាកម្ម",
"serviceQueues": "Service queues",
"sex": "ភេទ",
Expand Down

0 comments on commit f83b5b5

Please sign in to comment.