Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from HospitalRun/master
Browse files Browse the repository at this point in the history
Merge from Origin
  • Loading branch information
wwbarros authored Mar 11, 2020
2 parents 53f07fb + e8445f8 commit 0639e17
Show file tree
Hide file tree
Showing 65 changed files with 634 additions and 184 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12.x, 13.x]
node-version: [12.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
# exclude:
# - os: windows-latest
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12.x, 13.x]
node-version: [12.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
# exclude:
# - os: windows-latest
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ before_script:
- npm run lint
script:
- npm run build
after_script:
- COVERALLS_REPO_TOKEN=$coveralls_repo_token npm run coveralls

notifications:
email:
on_success: never
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"react-redux": "~7.2.0",
"react-router": "~5.1.2",
"react-router-dom": "~5.1.2",
"react-scripts": "3.4.0",
"react-scripts": "~3.4.0",
"redux": "~4.0.5",
"redux-thunk": "~2.3.0",
"shortid": "^2.2.15",
Expand Down Expand Up @@ -60,8 +60,8 @@
"@types/redux-mock-store": "~1.0.1",
"@types/shortid": "^0.0.29",
"@types/uuid": "^7.0.0",
"@typescript-eslint/eslint-plugin": "~2.22.0",
"@typescript-eslint/parser": "~2.22.0",
"@typescript-eslint/eslint-plugin": "~2.23.0",
"@typescript-eslint/parser": "~2.23.0",
"commitizen": "~4.0.3",
"commitlint-config-cz": "~0.13.0",
"coveralls": "~3.0.9",
Expand All @@ -77,7 +77,7 @@
"eslint-plugin-jest": "~23.8.0",
"eslint-plugin-jsx-a11y": "~6.2.3",
"eslint-plugin-prettier": "~3.1.1",
"eslint-plugin-react": "~7.18.0",
"eslint-plugin-react": "~7.19.0",
"eslint-plugin-react-hooks": "~2.5.0",
"history": "~4.10.1",
"husky": "~4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/HospitalRun.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ describe('HospitalRun', () => {
expect(store.getActions()).toContainEqual(
addBreadcrumbs([
{ i18nKey: 'scheduling.appointments.label', location: '/appointments' },
{ i18nKey: 'scheduling.appointments.newAppointment', location: '/appointments/new' },
{ i18nKey: 'scheduling.appointments.new', location: '/appointments/new' },
{ i18nKey: 'dashboard.label', location: '/' },
]),
)
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/components/Navbar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('Navbar', () => {
'scheduling.appointments.label',
)
expect(scheduleLinkList.first().props().children[1].props.children).toEqual(
'scheduling.appointments.newAppointment',
'scheduling.appointments.new',
)
})

Expand Down
4 changes: 1 addition & 3 deletions src/__tests__/scheduling/appointments/Appointments.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ describe('Appointments', () => {
})

const actualButtons: React.ReactNode[] = setButtonToolBarSpy.mock.calls[0][0]
expect((actualButtons[0] as any).props.children).toEqual(
'scheduling.appointments.newAppointment',
)
expect((actualButtons[0] as any).props.children).toEqual('scheduling.appointments.new')
})

it('should render a calendar with the proper events', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('New Appointment', () => {
await setup()
})

expect(titleUtil.default).toHaveBeenCalledWith('scheduling.appointments.newAppointment')
expect(titleUtil.default).toHaveBeenCalledWith('scheduling.appointments.new')
})
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Navbar = () => {
},
{
type: 'link',
label: t('scheduling.appointments.newAppointment'),
label: t('scheduling.appointments.new'),
onClick: () => {
history.push('/appointments/new')
},
Expand Down
30 changes: 0 additions & 30 deletions src/i18n.js

This file was deleted.

64 changes: 64 additions & 0 deletions src/i18n.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import i18n from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import { initReactI18next } from 'react-i18next'

import translationAR from './locales/ar/translations'
import translationDE from './locales/de/translations'
import translationEnUs from './locales/enUs/translations'
import translationES from './locales/es/translations'
import translationIN from './locales/in/translations'
import translationJA from './locales/ja/translations'
import translationPtBR from './locales/ptBr/translations'
import translationRU from './locales/ru/translations'
import translationZR from './locales/zr/translations'

const resources = {
ar: {
translation: translationAR,
},
de: {
translation: translationDE,
},
en: {
translation: translationEnUs,
},
es: {
translation: translationES,
},
in: {
translation: translationIN,
},
ja: {
translation: translationJA,
},
pt: {
translation: translationPtBR,
},
ru: {
translation: translationRU,
},
zr: {
translation: translationZR,
},
}

i18n
// load translation using xhr -> see /public/locales
// learn more: https://github.com/i18next/i18next-xhr-backend
// detect user language
// learn more: https://github.com/i18next/i18next-browser-languageDetector
.use(LanguageDetector)
// pass the i18n instance to react-i18next.
.use(initReactI18next)
// init i18next
// for all options read: https://www.i18next.com/overview/configuration-options
.init({
fallbackLng: 'en',
debug: true,
resources,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
})

export default i18n
9 changes: 9 additions & 0 deletions src/locales/ar/translations/actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
actions: {
edit: 'تصحيح',
save: 'حفظ',
cancel: 'إلغاء',
new: 'الجديد',
list: 'قائمة',
},
}
5 changes: 5 additions & 0 deletions src/locales/ar/translations/dashboard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
dashboard: {
label: 'لوحة القيادة',
},
}
11 changes: 11 additions & 0 deletions src/locales/ar/translations/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import actions from './actions'
import dashboard from './dashboard'
import patient from './patient'
import patients from './patients'

export default {
...actions,
...dashboard,
...patient,
...patients,
}
6 changes: 6 additions & 0 deletions src/locales/ar/translations/patient/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
patient: {
firstName: 'الاسم الاول',
lastName: 'الكنية',
},
}
8 changes: 8 additions & 0 deletions src/locales/ar/translations/patients/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
patients: {
label: 'المرضى',
viewPatients: 'عرض المرضى',
viewPatient: 'عرض المريض',
newPatient: 'مريض جديد',
},
}
9 changes: 9 additions & 0 deletions src/locales/de/translations/actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
actions: {
edit: 'Bearbeiten',
save: 'speichern',
cancel: 'Stornieren',
new: 'Neu',
list: 'Liste',
},
}
5 changes: 5 additions & 0 deletions src/locales/de/translations/dashboard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
dashboard: {
label: 'Instrumententafel',
},
}
11 changes: 11 additions & 0 deletions src/locales/de/translations/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import actions from './actions'
import dashboard from './dashboard'
import patient from './patient'
import patients from './patients'

export default {
...actions,
...dashboard,
...patient,
...patients,
}
6 changes: 6 additions & 0 deletions src/locales/de/translations/patient/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
patient: {
firstName: 'Vorname',
lastName: 'Nachname',
},
}
8 changes: 8 additions & 0 deletions src/locales/de/translations/patients/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
patients: {
label: 'Patienten',
viewPatients: 'Patienten anzeigen',
viewPatient: 'Patient anzeigen',
newPatient: 'Neuer Patient',
},
}
Loading

0 comments on commit 0639e17

Please # to comment.