Skip to content

Commit

Permalink
fix: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Dec 13, 2024
1 parent 0411747 commit 51add82
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
16 changes: 14 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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: 2024-11-07T11:57:59.094Z\n"
"PO-Revision-Date: 2024-11-07T11:57:59.094Z\n"
"POT-Creation-Date: 2024-12-13T11:35:42.356Z\n"
"PO-Revision-Date: 2024-12-13T11:35:42.356Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -101,6 +101,18 @@ msgstr "Date of enrollment"
msgid "Last updated"
msgstr "Last updated"

msgid "Lat"
msgstr "Lat"

msgid "Long"
msgstr "Long"

msgid "Show less"
msgstr "Show less"

msgid "Show more"
msgstr "Show more"

msgid "error encountered during field validation"
msgstr "error encountered during field validation"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import React from 'react';
import i18n from '@dhis2/d2-i18n';

type Props = $ReadOnly<{|
latitude: number | string,
Expand All @@ -10,8 +11,8 @@ const toSixDecimal = value => (parseFloat(value) ? parseFloat(value).toFixed(6)

export const MinimalCoordinates = ({ latitude, longitude }: Props) => (
<div>
lat: {toSixDecimal(latitude)} <br />
long: {toSixDecimal(longitude)}
{i18n.t('Lat')}: {toSixDecimal(latitude)}<br />
{i18n.t('Long')}: {toSixDecimal(longitude)}
</div>
);

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import React, { useState } from 'react';
import i18n from '@dhis2/d2-i18n';
import { withStyles } from '@material-ui/core/styles';
import { IconChevronUp16, IconChevronDown16, colors, spacers } from '@dhis2/ui';

Expand Down Expand Up @@ -40,14 +41,14 @@ const PolygonCoordinatesPlain = ({ coordinates, classes }: Props) => {
{coordinates.slice(0, showMore ? coordinates.length : 1).map((coordinatePair, index) => (
// eslint-disable-next-line react/no-array-index-key
<div key={index}>
{`lat: ${coordinatePair[1]}`}<br />
{`long: ${coordinatePair[0]}`}
{`${i18n('lat')}: ${coordinatePair[1]}`}<br />
{`${i18n('long')}: ${coordinatePair[0]}`}
</div>
))}
</div>
<div className={classes.buttonContainer}>
<button className={classes.viewButton} onClick={() => setShowMore(!showMore)}>
{showMore ? 'Show Less' : 'Show More'}
{showMore ? i18n.t('Show less') : i18n.t('Show more')}
{showMore ? <IconChevronUp16 /> : <IconChevronDown16 />}
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import React, { useMemo } from 'react';
import i18n from '@dhis2/d2-i18n';
import type { DataElement } from '../../../metaData';
import { dataElementTypes } from '../../../metaData';
import type { Props } from './EventChangelogWrapper.types';
Expand Down Expand Up @@ -36,7 +37,7 @@ export const EventChangelogWrapper = ({ formFoundation, eventId, eventData, ...p
acc[key] = {
id: key,
name: contextLabels[key],
type: dataElementTypes.DATE,
type: dataElementTypes.DATETIME,
};

return acc;
Expand All @@ -45,7 +46,7 @@ export const EventChangelogWrapper = ({ formFoundation, eventId, eventData, ...p
const additionalFields = formFoundation.featureType !== 'None' ? {
geometry: {
id: 'geometry',
name: formFoundation.featureType,
name: formFoundation.featureType === 'Polygon' ? i18n.t('Area') : i18n.t('Coordinate'),
type: formFoundation.featureType === 'Polygon' ?
dataElementTypes.POLYGON : dataElementTypes.COORDINATE,
},
Expand Down

0 comments on commit 51add82

Please sign in to comment.