From fdb33fb519b9987ff74f268fcfea306e93ca0b0a Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 20 Apr 2021 15:38:27 +0200 Subject: [PATCH] fix(translations): [DHIS2-8998] missing translation (#1617) * fix(translations): missing translation * fix(translations): no string * fix(translations): [DHIS2-8998] transalte more strings (cherry picked from commit 70b103e619d12360fc0f6dca371bb129f31abdb2) --- i18n/en.pot | 34 +++++++++++++++++-- .../DataEntry/EditEventDataEntry.component.js | 2 +- .../NewEvent/DataEntry/DataEntry.component.js | 6 ++-- .../defaultConfigGetter.js | 2 +- .../EditEventDataEntry.component.js | 2 +- .../EventDetailsSection.component.js | 2 +- .../ViewEventDataEntry.component.js | 4 +-- .../Section/SectionHeaderSimple.component.js | 3 +- .../SearchOrgUnitSelector.component.js | 6 ++-- .../capture-core/converters/clientToList.js | 5 +-- .../capture-core/converters/clientToView.js | 5 +-- .../CoordinateField.component.js | 4 +-- 12 files changed, 54 insertions(+), 21 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index 95925ebf5f..280fd29581 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: 2020-06-08T15:14:01.107Z\n" -"PO-Revision-Date: 2020-06-08T15:14:01.107Z\n" +"POT-Creation-Date: 2021-04-21T10:03:09.217Z\n" +"PO-Revision-Date: 2021-04-21T10:03:09.217Z\n" msgid "Please provide a valid date" msgstr "" @@ -302,6 +302,9 @@ msgstr "" msgid "Write comment" msgstr "" +msgid "Complete event" +msgstr "" + msgid "Basic info" msgstr "" @@ -500,6 +503,9 @@ msgid "" "exists" msgstr "" +msgid "Assigned to" +msgstr "" + msgid "New event" msgstr "" @@ -629,6 +635,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" @@ -694,6 +706,18 @@ msgstr "" msgid "Add relationship" msgstr "" +msgid "Open" +msgstr "" + +msgid "All accessible" +msgstr "" + +msgid "Selected" +msgstr "" + +msgid "Organisation unit scope" +msgstr "" + msgid "Selected program" msgstr "" @@ -745,6 +769,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/Pages/EditEvent/DataEntry/EditEventDataEntry.component.js b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/EditEventDataEntry.component.js index ca328dbafa..9e91e9c42a 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/NewEvent/DataEntry/DataEntry.component.js b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/DataEntry.component.js index 9aacd51610..5bc18b108e 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/DataEntry.component.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/DataEntry.component.js @@ -240,8 +240,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, @@ -279,7 +279,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/NewEvent/DataEntry/epics/defaultColumnConfiguration/defaultConfigGetter.js b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/defaultColumnConfiguration/defaultConfigGetter.js index 75cb0af440..40bad33173 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/defaultColumnConfiguration/defaultConfigGetter.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/defaultColumnConfiguration/defaultConfigGetter.js @@ -36,7 +36,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/ViewEvent/EventDetailsSection/EditEventDataEntry/EditEventDataEntry.component.js b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/EditEventDataEntry.component.js index 5a1e9dbd92..03cfc62918 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 d04ac649a6..bf517fa0ba 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 @@ -113,7 +113,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 37e7fc703e..a439cabdf3 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/Section/SectionHeaderSimple.component.js b/src/core_modules/capture-core/components/Section/SectionHeaderSimple.component.js index 3044578734..58fe23c808 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 => ({ @@ -80,7 +81,7 @@ class SectionHeaderSimple extends Component { if (onChangeCollapseState) { return ( {this.props.isCollapsed ? : } 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 ( convertRangeForDisplay(convertDateForListDisplay, value), [elementTypes.DATETIME]: convertDateTimeForListDisplay, [elementTypes.TIME]: convertTimeForListDisplay, - [elementTypes.TRUE_ONLY]: () => 'Yes', - [elementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? 'Yes' : 'No'), + [elementTypes.TRUE_ONLY]: () => i18n.t('Yes'), + [elementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), [elementTypes.COORDINATE]: MinimalCoordinates, [elementTypes.AGE]: convertDateForListDisplay, [elementTypes.FILE_RESOURCE]: convertResourceForDisplay, diff --git a/src/core_modules/capture-core/converters/clientToView.js b/src/core_modules/capture-core/converters/clientToView.js index 64dcf923e4..bede5eb7b6 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 elementTypes from '../metaData/DataElement/elementTypes'; import DataElement from '../metaData/DataElement/DataElement'; @@ -52,8 +53,8 @@ const valueConvertersForType = { [elementTypes.DATE]: convertDateForView, [elementTypes.DATETIME]: convertDateTimeForView, [elementTypes.TIME]: convertTimeForView, - [elementTypes.TRUE_ONLY]: () => 'Yes', - [elementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? 'Yes' : 'No'), + [elementTypes.TRUE_ONLY]: () => i18n.t('Yes'), + [elementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), [elementTypes.COORDINATE]: MinimalCoordinates, [elementTypes.AGE]: convertDateForView, [elementTypes.FILE_RESOURCE]: convertResourceForView, diff --git a/src/core_modules/capture-ui/CoordinateField/CoordinateField.component.js b/src/core_modules/capture-ui/CoordinateField/CoordinateField.component.js index 7f3c7ebf61..51028da1ff 100644 --- a/src/core_modules/capture-ui/CoordinateField/CoordinateField.component.js +++ b/src/core_modules/capture-ui/CoordinateField/CoordinateField.component.js @@ -37,8 +37,8 @@ type State = { } const coordinateKeys = { - LATITUDE: 'latitude', - LONGITUDE: 'longitude', + LATITUDE: i18n.t('Latitude'), + LONGITUDE: i18n.t('Longitude'), }; export default class D2Coordinate extends React.Component {