From 4fee1c970f42f68a0e195e7e73b5a5a10cafecaa 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 cb838ebb0b..0d779b1f6d 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-08-26T13:05:11.412Z\n" -"PO-Revision-Date: 2020-08-26T13:05:11.412Z\n" +"POT-Creation-Date: 2021-04-21T09:54:58.143Z\n" +"PO-Revision-Date: 2021-04-21T09:54:58.143Z\n" msgid "Choose one or more dates..." msgstr "" @@ -377,6 +377,9 @@ msgstr "" msgid "Write comment" msgstr "" +msgid "Complete event" +msgstr "" + msgid "Basic info" msgstr "" @@ -563,6 +566,9 @@ msgid "" "exists" msgstr "" +msgid "Assigned to" +msgstr "" + msgid "New event" msgstr "" @@ -683,6 +689,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" @@ -709,6 +721,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 "" @@ -760,6 +784,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 8b944bbc82..15117b759d 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 7d401d772e..e6c34a4bf0 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 @@ -239,8 +239,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, @@ -278,7 +278,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 3911db6a9f..99d0cbebc7 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 @@ -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/ViewEvent/EventDetailsSection/EditEventDataEntry/EditEventDataEntry.component.js b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/EditEventDataEntry.component.js index 704f9fd7c7..d40019e5a4 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 708fbf1e8e..6da3a4768c 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 f67f6a822e..a5fb778608 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 @@ -153,7 +153,7 @@ const buildGeometrySettingsFn = () => ({ }); return createComponentProps(props, { - label: 'Coordinate', + label: i18n.t('Coordinate'), valueConverter: value => pointDataElement.convertValue(value, valueConvertFn), }); }, @@ -175,7 +175,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 648eb90cc6..311cb59ec4 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 ( 'Yes', + [elementTypes.TRUE_ONLY]: () => i18n.t('Yes'), // $FlowFixMe[prop-missing] automated comment - [elementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? 'Yes' : 'No'), + [elementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), // $FlowFixMe[prop-missing] automated comment [elementTypes.COORDINATE]: MinimalCoordinates, // $FlowFixMe[prop-missing] automated comment diff --git a/src/core_modules/capture-core/converters/clientToView.js b/src/core_modules/capture-core/converters/clientToView.js index b9b900d979..a69d0d9cc7 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'; @@ -62,9 +63,9 @@ const valueConvertersForType = { // $FlowFixMe[prop-missing] automated comment [elementTypes.TIME]: convertTimeForView, // $FlowFixMe[prop-missing] automated comment - [elementTypes.TRUE_ONLY]: () => 'Yes', + [elementTypes.TRUE_ONLY]: () => i18n.t('Yes'), // $FlowFixMe[prop-missing] automated comment - [elementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? 'Yes' : 'No'), + [elementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')), // $FlowFixMe[prop-missing] automated comment [elementTypes.COORDINATE]: MinimalCoordinates, // $FlowFixMe[prop-missing] automated comment diff --git a/src/core_modules/capture-ui/CoordinateField/CoordinateField.component.js b/src/core_modules/capture-ui/CoordinateField/CoordinateField.component.js index ae8b5fd22f..a914c9c3fb 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 {