Skip to content

Commit

Permalink
fix(translations): [DHIS2-8998] missing translation (#1617)
Browse files Browse the repository at this point in the history
* fix(translations): missing translation

* fix(translations): no string

* fix(translations): [DHIS2-8998] transalte more strings

(cherry picked from commit 70b103e)
  • Loading branch information
simonadomnisoru committed Apr 21, 2021
1 parent 2e8a02f commit 587c521
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 25 deletions.
34 changes: 29 additions & 5 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: 2021-04-06T22:21:56.698Z\n"
"PO-Revision-Date: 2021-04-06T22:21:56.698Z\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 ""
Expand Down Expand Up @@ -140,6 +140,9 @@ msgstr ""
msgid "Search for user"
msgstr ""

msgid "Complete event"
msgstr ""

msgid "Basic info"
msgstr ""

Expand Down Expand Up @@ -177,6 +180,9 @@ msgstr ""
msgid "Completed"
msgstr ""

msgid "Assigned to"
msgstr ""

msgid "Please add or cancel comment before saving the event"
msgstr ""

Expand Down Expand Up @@ -640,9 +646,6 @@ msgstr ""
msgid "Cancelled"
msgstr ""

msgid "Assigned to"
msgstr ""

msgid "Registering unit"
msgstr ""

Expand Down Expand Up @@ -807,6 +810,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"
Expand Down Expand Up @@ -842,6 +851,15 @@ msgstr ""
msgid "Results found"
msgstr ""

msgid "Open"
msgstr ""

msgid "All accessible"
msgstr ""

msgid "Organisation unit scope"
msgstr ""

msgid "Search {{uniqueAttrName}}"
msgstr ""

Expand Down Expand Up @@ -896,6 +914,12 @@ msgstr ""
msgid "tracked entity instance"
msgstr ""

msgid "Latitude"
msgstr ""

msgid "Longitude"
msgstr ""

msgid "Set coordinate"
msgstr ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const getDefaultMainConfig = (stage: ProgramStage): Array<MainColumnConfig> => {
id: mainPropertyNames.ASSIGNEE,
visible: true,
type: 'ASSIGNEE',
header: 'Assigned to',
header: i18n.t('Assigned to'),
apiName: 'assignedUser',
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class EventDetailsSection extends Component<Props> {
return (
<div className={classes.container}>
<ViewEventSection
header={<ViewEventSectionHeader text="Event details" icon={InfoIcon} />}
header={<ViewEventSectionHeader text={i18n.t('Event details')} icon={InfoIcon} />}
>
<div className={classes.content}>
{this.renderDataEntryContainer()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const buildGeometrySettingsFn = () => ({
});

return createComponentProps(props, {
label: 'Coordinate',
label: i18n.t('Coordinate'),
valueConverter: value => pointDataElement.convertValue(value, valueConvertFn),
});
},
Expand All @@ -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),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => ({
Expand Down Expand Up @@ -87,7 +88,7 @@ class SectionHeaderSimple extends Component<Props> {
<IconButton
data-test="collapsible-button"
disabled={!this.props.isCollapseButtonEnabled}
title={this.props.isCollapsed ? 'Åpne' : 'Lukk'}
title={this.props.isCollapsed ? i18n.t('Open') : i18n.t('Close')}
onClick={this.handleChangeCollapse}
>
{this.props.isCollapsed ? <KeyboardArrowDown /> : <KeyboardArrowUp />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
];
Expand All @@ -77,7 +77,7 @@ class SearchOrgUnitSelector extends React.Component<Props> {
return (
<TeiSearchSelectionBoxes
options={options}
label="Organisation unit scope"
label={i18n.t('Organisation unit scope')}
styles={selectionBoxesStyles}
onSelect={this.onSelectOrgUnitScope}
value={selectedOrgUnitScope}
Expand Down
5 changes: 3 additions & 2 deletions src/core_modules/capture-core/converters/clientToList.js
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';
import { moment } from 'capture-core-utils/moment';
import { dataElementTypes, type DataElement } from '../metaData';
import { convertMomentToDateFormatString } from '../utils/converters/date';
Expand Down Expand Up @@ -67,8 +68,8 @@ const valueConvertersForType = {
[dataElementTypes.DATE_RANGE]: value => convertRangeForDisplay(convertDateForListDisplay, value),
[dataElementTypes.DATETIME]: convertDateTimeForListDisplay,
[dataElementTypes.TIME]: convertTimeForListDisplay,
[dataElementTypes.TRUE_ONLY]: () => 'Yes',
[dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? 'Yes' : 'No'),
[dataElementTypes.TRUE_ONLY]: () => i18n.t('Yes'),
[dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')),
[dataElementTypes.COORDINATE]: MinimalCoordinates,
[dataElementTypes.AGE]: convertDateForListDisplay,
[dataElementTypes.FILE_RESOURCE]: convertResourceForDisplay,
Expand Down
5 changes: 3 additions & 2 deletions src/core_modules/capture-core/converters/clientToView.js
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';
import { moment } from 'capture-core-utils/moment';
import { dataElementTypes, type DataElement } from '../metaData';
import { convertMomentToDateFormatString } from '../utils/converters/date';
Expand Down Expand Up @@ -51,8 +52,8 @@ const valueConvertersForType = {
[dataElementTypes.DATE]: convertDateForView,
[dataElementTypes.DATETIME]: convertDateTimeForView,
[dataElementTypes.TIME]: convertTimeForView,
[dataElementTypes.TRUE_ONLY]: () => 'Yes',
[dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? 'Yes' : 'No'),
[dataElementTypes.TRUE_ONLY]: () => i18n.t('Yes'),
[dataElementTypes.BOOLEAN]: (rawValue: boolean) => (rawValue ? i18n.t('Yes') : i18n.t('No')),
[dataElementTypes.COORDINATE]: MinimalCoordinates,
[dataElementTypes.AGE]: convertDateForView,
[dataElementTypes.FILE_RESOURCE]: convertResourceForView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Props, State> {
Expand Down

0 comments on commit 587c521

Please sign in to comment.