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 17c67cc commit fdb33fb
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 21 deletions.
34 changes: 32 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: 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 ""
Expand Down Expand Up @@ -302,6 +302,9 @@ msgstr ""
msgid "Write comment"
msgstr ""

msgid "Complete event"
msgstr ""

msgid "Basic info"
msgstr ""

Expand Down Expand Up @@ -500,6 +503,9 @@ msgid ""
"exists"
msgstr ""

msgid "Assigned to"
msgstr ""

msgid "New event"
msgstr ""

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -745,6 +769,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 @@ -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 @@ -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,
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
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 @@ -113,7 +113,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 @@ -80,7 +81,7 @@ class SectionHeaderSimple extends Component<Props> {
if (onChangeCollapseState) {
return (
<IconButton
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 elementTypes from '../metaData/DataElement/elementTypes';
import DataElement from '../metaData/DataElement/DataElement';
Expand Down Expand Up @@ -61,8 +62,8 @@ const valueConvertersForType = {
[elementTypes.DATE_RANGE]: value => 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,
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 elementTypes from '../metaData/DataElement/elementTypes';
import DataElement from '../metaData/DataElement/DataElement';
Expand Down Expand Up @@ -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,
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 fdb33fb

Please sign in to comment.