From 8e5b01dfa951d809a682ade8393949a377d4e5da Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Wed, 14 Apr 2021 15:06:40 +0200 Subject: [PATCH 1/3] fix(translations): missing translation --- i18n/en.pot | 31 ++++++++++++++++--- .../DataEntry/DataEntry.component.js | 6 ++-- .../defaultConfigGetter.js | 2 +- .../DataEntry/EditEventDataEntry.component.js | 2 +- .../useDefaultColumnConfig.js | 2 +- .../EditEventDataEntry.component.js | 2 +- .../EventDetailsSection.component.js | 2 +- .../ViewEventDataEntry.component.js | 4 +-- .../SearchOrgUnitSelector.component.js | 6 ++-- .../CoordinateField.component.js | 4 +-- 10 files changed, 41 insertions(+), 20 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index d9090613f7..5b634ba3a6 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2021-03-04T11:19:33.496Z\n" -"PO-Revision-Date: 2021-03-04T11:19:33.496Z\n" +"POT-Creation-Date: 2021-04-14T12:28:35.610Z\n" +"PO-Revision-Date: 2021-04-14T12:28:35.610Z\n" msgid "Choose one or more dates..." msgstr "" @@ -140,6 +140,9 @@ msgstr "" msgid "Search for user" msgstr "" +msgid "Complete event" +msgstr "" + msgid "Basic info" msgstr "" @@ -177,6 +180,9 @@ msgstr "" msgid "Completed" msgstr "" +msgid "Assigned to" +msgstr "" + msgid "Please add or cancel comment before saving the event" msgstr "" @@ -649,9 +655,6 @@ msgstr "" msgid "Cancelled" msgstr "" -msgid "Assigned to" -msgstr "" - msgid "Registering unit" msgstr "" @@ -819,6 +822,12 @@ msgstr "" msgid "You dont have access to edit this event" msgstr "" +msgid "Event details" +msgstr "" + +msgid "Event completed" +msgstr "" + msgid "" "Leaving this page will discard any selections you made for a new " "relationship" @@ -851,6 +860,12 @@ msgstr "" msgid "Results found" msgstr "" +msgid "All accessible" +msgstr "" + +msgid "Organisation unit scope" +msgstr "" + msgid "Search {{uniqueAttrName}}" msgstr "" @@ -899,6 +914,12 @@ msgstr "" msgid "tracked entity instance" msgstr "" +msgid "Latitude" +msgstr "" + +msgid "Longitude" +msgstr "" + msgid "Set coordinate" msgstr "" diff --git a/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/DataEntryWrapper/DataEntry/DataEntry.component.js b/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/DataEntryWrapper/DataEntry/DataEntry.component.js index f5323681a6..f8c1ecea97 100644 --- a/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/DataEntryWrapper/DataEntry/DataEntry.component.js +++ b/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/DataEntryWrapper/DataEntry/DataEntry.component.js @@ -236,8 +236,8 @@ const buildGeometrySettingsFn = () => ({ return createComponentProps(props, { width: props && props.formHorizontal ? 150 : 350, - label: 'Coordinate', - dialogLabel: 'Coordinate', + label: i18n.t('Coordinate'), + dialogLabel: i18n.t('Coordinate'), required: false, orientation: getOrientation(props.formHorizontal), shrinkDisabled: props.formHorizontal, @@ -275,7 +275,7 @@ const buildCompleteFieldSettingsFn = () => { const completeSettings = { getComponent: () => completeComponent, getComponentProps: (props: Object) => createComponentProps(props, { - label: 'Complete event', + label: i18n.t('Complete event'), id: 'complete', }), getPropName: () => 'complete', diff --git a/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/DataEntryWrapper/DataEntry/epics/defaultColumnConfiguration/defaultConfigGetter.js b/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/DataEntryWrapper/DataEntry/epics/defaultColumnConfiguration/defaultConfigGetter.js index f4772870d0..540ab7d797 100644 --- a/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/DataEntryWrapper/DataEntry/epics/defaultColumnConfiguration/defaultConfigGetter.js +++ b/src/core_modules/capture-core/components/DataEntries/SingleEventRegistrationEntry/DataEntryWrapper/DataEntry/epics/defaultColumnConfiguration/defaultConfigGetter.js @@ -37,7 +37,7 @@ export const getDefaultMainConfig = (stage: ProgramStage) => { id: mainPropertyNames.ASSIGNEE, type: 'ASSIGNEE', apiName: 'assignedUser', - header: 'Assigned to', + header: i18n.t('Assigned to'), visible: true, isMainProperty: true, }; diff --git a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/EditEventDataEntry.component.js b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/EditEventDataEntry.component.js index 1ed1c48eef..b46e9e4b1e 100644 --- a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/EditEventDataEntry.component.js +++ b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/EditEventDataEntry.component.js @@ -233,7 +233,7 @@ const buildCompleteFieldSettingsFn = () => { const completeSettings = { getComponent: () => completeComponent, getComponentProps: (props: Object) => createComponentProps(props, { - label: 'Complete event', + label: i18n.t('Complete event'), id: 'complete', }), getPropName: () => 'complete', diff --git a/src/core_modules/capture-core/components/Pages/MainPage/EventWorkingListsCommon/useDefaultColumnConfiguration/useDefaultColumnConfig.js b/src/core_modules/capture-core/components/Pages/MainPage/EventWorkingListsCommon/useDefaultColumnConfiguration/useDefaultColumnConfig.js index 8ba2e4f800..e684d9cd4c 100644 --- a/src/core_modules/capture-core/components/Pages/MainPage/EventWorkingListsCommon/useDefaultColumnConfiguration/useDefaultColumnConfig.js +++ b/src/core_modules/capture-core/components/Pages/MainPage/EventWorkingListsCommon/useDefaultColumnConfiguration/useDefaultColumnConfig.js @@ -38,7 +38,7 @@ const getDefaultMainConfig = (stage: ProgramStage): Array => { id: mainPropertyNames.ASSIGNEE, visible: true, type: 'ASSIGNEE', - header: 'Assigned to', + header: i18n.t('Assigned to'), apiName: 'assignedUser', }); } diff --git a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/EditEventDataEntry.component.js b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/EditEventDataEntry.component.js index 7a668a3e22..e259ae2705 100644 --- a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/EditEventDataEntry.component.js +++ b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/EditEventDataEntry.component.js @@ -224,7 +224,7 @@ const buildCompleteFieldSettingsFn = () => { const completeSettings = { getComponent: () => completeComponent, getComponentProps: (props: Object) => createComponentProps(props, { - label: 'Complete event', + label: i18n.t('Complete event'), id: 'complete', }), getPropName: () => 'complete', diff --git a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EventDetailsSection.component.js b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EventDetailsSection.component.js index 0ac53777fa..293bfe9436 100644 --- a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EventDetailsSection.component.js +++ b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EventDetailsSection.component.js @@ -115,7 +115,7 @@ class EventDetailsSection extends Component { return (
} + header={} >
{this.renderDataEntryContainer()} diff --git a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/ViewEventDataEntry/ViewEventDataEntry.component.js b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/ViewEventDataEntry/ViewEventDataEntry.component.js index 3346be7851..c3d15a0441 100644 --- a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/ViewEventDataEntry/ViewEventDataEntry.component.js +++ b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/ViewEventDataEntry/ViewEventDataEntry.component.js @@ -151,7 +151,7 @@ const buildGeometrySettingsFn = () => ({ }); return createComponentProps(props, { - label: 'Coordinate', + label: i18n.t('Coordinate'), valueConverter: value => pointDataElement.convertValue(value, valueConvertFn), }); }, @@ -172,7 +172,7 @@ const buildCompleteFieldSettingsFn = () => { const completeSettings = { getComponent: () => viewModeComponent, getComponentProps: (props: Object) => createComponentProps(props, { - label: 'Event completed', + label: i18n.t('Event completed'), id: dataElement.id, valueConverter: value => dataElement.convertValue(value, valueConvertFn), }), diff --git a/src/core_modules/capture-core/components/TeiSearch/SearchOrgUnitSelector/SearchOrgUnitSelector.component.js b/src/core_modules/capture-core/components/TeiSearch/SearchOrgUnitSelector/SearchOrgUnitSelector.component.js index 3ac86cb145..e13fd1ab73 100644 --- a/src/core_modules/capture-core/components/TeiSearch/SearchOrgUnitSelector/SearchOrgUnitSelector.component.js +++ b/src/core_modules/capture-core/components/TeiSearch/SearchOrgUnitSelector/SearchOrgUnitSelector.component.js @@ -50,11 +50,11 @@ const selectionBoxesStyles = { const options = [ { - name: 'All accessible', + name: i18n.t('All accessible'), value: 'ACCESSIBLE', }, { - name: 'Selected', + name: i18n.t('Selected'), value: 'SELECTED', }, ]; @@ -77,7 +77,7 @@ class SearchOrgUnitSelector extends React.Component { return ( { From c3f04379078d3f74b854d4c0340aa93a163a9bc3 Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Fri, 16 Apr 2021 16:01:07 +0200 Subject: [PATCH 2/3] fix(translations): no string --- src/core_modules/capture-core/converters/clientToList.js | 3 ++- src/core_modules/capture-core/converters/clientToView.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core_modules/capture-core/converters/clientToList.js b/src/core_modules/capture-core/converters/clientToList.js index 1b160321fc..d02e8c23a9 100644 --- a/src/core_modules/capture-core/converters/clientToList.js +++ b/src/core_modules/capture-core/converters/clientToList.js @@ -1,5 +1,6 @@ // @flow import React from 'react'; +import i18n from '@dhis2/d2-i18n'; import { moment } from 'capture-core-utils/moment'; import { dataElementTypes, type DataElement } from '../metaData'; import { convertMomentToDateFormatString } from '../utils/converters/date'; @@ -68,7 +69,7 @@ const valueConvertersForType = { [dataElementTypes.DATETIME]: convertDateTimeForListDisplay, [dataElementTypes.TIME]: convertTimeForListDisplay, [dataElementTypes.TRUE_ONLY]: () => 'Yes', - [dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? 'Yes' : 'No'), + [dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), [dataElementTypes.COORDINATE]: MinimalCoordinates, [dataElementTypes.AGE]: convertDateForListDisplay, [dataElementTypes.FILE_RESOURCE]: convertResourceForDisplay, diff --git a/src/core_modules/capture-core/converters/clientToView.js b/src/core_modules/capture-core/converters/clientToView.js index fcdb22adaf..da444ba69b 100644 --- a/src/core_modules/capture-core/converters/clientToView.js +++ b/src/core_modules/capture-core/converters/clientToView.js @@ -1,5 +1,6 @@ // @flow import React from 'react'; +import i18n from '@dhis2/d2-i18n'; import { moment } from 'capture-core-utils/moment'; import { dataElementTypes, type DataElement } from '../metaData'; import { convertMomentToDateFormatString } from '../utils/converters/date'; @@ -52,7 +53,7 @@ const valueConvertersForType = { [dataElementTypes.DATETIME]: convertDateTimeForView, [dataElementTypes.TIME]: convertTimeForView, [dataElementTypes.TRUE_ONLY]: () => 'Yes', - [dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? 'Yes' : 'No'), + [dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), [dataElementTypes.COORDINATE]: MinimalCoordinates, [dataElementTypes.AGE]: convertDateForView, [dataElementTypes.FILE_RESOURCE]: convertResourceForView, From c9ac62c4445d053d75f842f35b2b9473fc50cd7d Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 20 Apr 2021 13:42:38 +0200 Subject: [PATCH 3/3] fix(translations): [DHIS2-8998] transalte more strings --- i18n/en.pot | 7 +++++-- .../components/Section/SectionHeaderSimple.component.js | 3 ++- src/core_modules/capture-core/converters/clientToList.js | 2 +- src/core_modules/capture-core/converters/clientToView.js | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index e73eba9f87..9e52f268e9 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2021-04-14T12:28:35.610Z\n" -"PO-Revision-Date: 2021-04-14T12:28:35.610Z\n" +"POT-Creation-Date: 2021-04-20T11:24:37.353Z\n" +"PO-Revision-Date: 2021-04-20T11:24:37.353Z\n" msgid "Choose one or more dates..." msgstr "" @@ -851,6 +851,9 @@ msgstr "" msgid "Results found" msgstr "" +msgid "Open" +msgstr "" + msgid "All accessible" msgstr "" diff --git a/src/core_modules/capture-core/components/Section/SectionHeaderSimple.component.js b/src/core_modules/capture-core/components/Section/SectionHeaderSimple.component.js index 3eec430f27..728e4ea04e 100644 --- a/src/core_modules/capture-core/components/Section/SectionHeaderSimple.component.js +++ b/src/core_modules/capture-core/components/Section/SectionHeaderSimple.component.js @@ -3,6 +3,7 @@ import React, { Component } from 'react'; import { withStyles } from '@material-ui/core/styles'; import IconButton from '@material-ui/core/IconButton'; +import i18n from '@dhis2/d2-i18n'; import { KeyboardArrowDown, KeyboardArrowUp } from '@material-ui/icons'; const styles = theme => ({ @@ -87,7 +88,7 @@ class SectionHeaderSimple extends Component { {this.props.isCollapsed ? : } diff --git a/src/core_modules/capture-core/converters/clientToList.js b/src/core_modules/capture-core/converters/clientToList.js index d02e8c23a9..60eb13b1ad 100644 --- a/src/core_modules/capture-core/converters/clientToList.js +++ b/src/core_modules/capture-core/converters/clientToList.js @@ -68,7 +68,7 @@ const valueConvertersForType = { [dataElementTypes.DATE_RANGE]: value => convertRangeForDisplay(convertDateForListDisplay, value), [dataElementTypes.DATETIME]: convertDateTimeForListDisplay, [dataElementTypes.TIME]: convertTimeForListDisplay, - [dataElementTypes.TRUE_ONLY]: () => 'Yes', + [dataElementTypes.TRUE_ONLY]: () => i18n.t('Yes'), [dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), [dataElementTypes.COORDINATE]: MinimalCoordinates, [dataElementTypes.AGE]: convertDateForListDisplay, diff --git a/src/core_modules/capture-core/converters/clientToView.js b/src/core_modules/capture-core/converters/clientToView.js index da444ba69b..3b5482562f 100644 --- a/src/core_modules/capture-core/converters/clientToView.js +++ b/src/core_modules/capture-core/converters/clientToView.js @@ -52,7 +52,7 @@ const valueConvertersForType = { [dataElementTypes.DATE]: convertDateForView, [dataElementTypes.DATETIME]: convertDateTimeForView, [dataElementTypes.TIME]: convertTimeForView, - [dataElementTypes.TRUE_ONLY]: () => 'Yes', + [dataElementTypes.TRUE_ONLY]: () => i18n.t('Yes'), [dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), [dataElementTypes.COORDINATE]: MinimalCoordinates, [dataElementTypes.AGE]: convertDateForView,